How to find max values in vector for each 10 rows

 채택된 답변

Jan
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

brother if i want max-1, i mean the result will be 9 19 29 39 49 59 69 79 89 99, how will be the code?
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?
@abdullah al-dulaimi: "the result will be 9 19 29 39 49 59 69 79 89 99"?
Do you mean:
x = 9:10:100

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Develop Apps Using App Designer에 대해 자세히 알아보기

제품

태그

질문:

2022년 12월 29일

댓글:

Jan
2022년 12월 29일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by