To find Maximum value and minimum value for each group of four rows for a 180*1 matrix
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
Akzeptierte Antwort
KSSV
am 27 Jul. 2021
A = rand(180,1) ;
B = reshape(A,12,[])' ;
themax = max(B) ;
themin = min(B) ;
0 Kommentare
Weitere Antworten (1)
Rik
am 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 Kommentare
Siehe auch
Kategorien
Mehr zu Loops and Conditional Statements finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!