To find Maximum value and minimum value for each group of four rows for a 180*1 matrix
1 view (last 30 days)
Show older comments
Say I have a 180x1 matrix. I have to find the max and min value of each 12 rows. e.g, max min value of 1-12th row and 13th to 24th row and so on..
0 Comments
Accepted Answer
KSSV
on 27 Jul 2021
A = rand(180,1) ;
B = reshape(A,12,[])' ;
themax = max(B) ;
themin = min(B) ;
0 Comments
More Answers (1)
Rik
on 27 Jul 2021
Easy if you reshape the vector to an array:
data=rand(180,1);
data_=reshape(data,12,[]);
max(data_,[],1)
min(data_,[],1)
0 Comments
See Also
Categories
Find more on Loops and Conditional Statements 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!