How to compare the length of two matrices and pick the shorter one?

3 ビュー (過去 30 日間)
matlabuser12
matlabuser12 2016 年 8 月 15 日
回答済み: Walter Roberson 2016 年 8 月 15 日
have two nx1 matrices that I want to say for whichever matrix is shorter use that length.

採用された回答

Walter Roberson
Walter Roberson 2016 年 8 月 15 日
shorter_length = min( length(FirstVector), length(SecondVector) );

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMultidimensional Arrays についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by