To find Maximum value and minimum value for each group of four rows for a 180*1 matrix
조회 수: 1 (최근 30일)
이전 댓글 표시
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
채택된 답변
KSSV
2021년 7월 27일
A = rand(180,1) ;
B = reshape(A,12,[])' ;
themax = max(B) ;
themin = min(B) ;
댓글 수: 0
추가 답변 (1개)
Rik
2021년 7월 27일
Easy if you reshape the vector to an array:
data=rand(180,1);
data_=reshape(data,12,[]);
max(data_,[],1)
min(data_,[],1)
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!