How to compare the length of two matrices and pick the shorter one?
2 views (last 30 days)
Show older comments
matlabuser12
on 15 Aug 2016
Answered: Walter Roberson
on 15 Aug 2016
have two nx1 matrices that I want to say for whichever matrix is shorter use that length.
0 Comments
Accepted Answer
Walter Roberson
on 15 Aug 2016
shorter_length = min( length(FirstVector), length(SecondVector) );
0 Comments
More Answers (0)
See Also
Categories
Find more on Multidimensional Arrays in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!