필터 지우기
필터 지우기

How do I find the max value over specific intervals of a column vector?

조회 수: 2 (최근 30일)
Scott Phillips
Scott Phillips 2017년 11월 3일
댓글: Leon Gosh 2023년 11월 19일
I have a column vector of 500 values of data that I need to find max values of and I would like to use a for loop to do it. I want to find the maximum value over every 10 data values, e.g. taking all of those 10 points and finding the maximum, and repeating this process for the next 10 values (1-10),(11-20), and so on. I've tried looping with specific steps but it doesn't work and I get some variation of the maximum of the entire list or just the specific points where the loop starts (1, 11, etc.). Could anyone point me in the right direction?

답변 (1개)

Roger Stafford
Roger Stafford 2017년 11월 3일
mx = max(reshape(M,10,[]),[],1);

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by