How to find max values in vector for each 10 rows
조회 수: 4 (최근 30일)
이전 댓글 표시
A=rand(1, 100)
For each 10 rows, i want to find max value
댓글 수: 0
채택된 답변
Jan
2022년 12월 29일
편집: Jan
2022년 12월 29일
With the bold guess, that you mean rand(100, 1) instead of rand(1:100):
data = rand(100, 1);
result = max(reshape(data, 10, 10))
% or explicitly:
result = max(reshape(data, 10, 10), [], 1)
댓글 수: 3
Walter Roberson
2022년 12월 29일
are you looking for maximum value minus 1? If so subtract 1 from result
Or are you looking for the indices where the maximums appear? Or for the indices where the second highest appear?
Jan
2022년 12월 29일
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Data Type Identification에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!