How to vectorize max / min number in row
Show older comments
Ho to vectorize the min and max value on each row for a matrix
a = linspace(2,5,10); b = linspace(0,8,10);
A = [a' b']
2.000000000000000 0
2.333333333333333 0.888888888888889
2.666666666666667 1.777777777777778
3.000000000000000 2.666666666666667
3.333333333333333 3.555555555555555
3.666666666666667 4.444444444444445
4.000000000000000 5.333333333333333
4.333333333333334 6.222222222222222
4.666666666666666 7.111111111111111
5.000000000000000 8.000000000000000
the result should be
maxr = 2, 2.33, 2.66,3 , 3.55 ...
minr = 0, 0.88, 1.77. 2.66, 3.33 ...
Accepted Answer
More Answers (0)
Categories
Find more on Creating and Concatenating Matrices 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!