To find Maximum value and minimum value for each group of four rows for a 180*1 matrix
4 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Joydeb Saha
el 27 de Jul. de 2021
Respondida: KSSV
el 27 de Jul. de 2021
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 comentarios
Respuesta aceptada
KSSV
el 27 de Jul. de 2021
A = rand(180,1) ;
B = reshape(A,12,[])' ;
themax = max(B) ;
themin = min(B) ;
0 comentarios
Más respuestas (1)
Rik
el 27 de Jul. de 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 comentarios
Ver también
Categorías
Más información sobre Creating and Concatenating Matrices en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!