Effacer les filtres
Effacer les filtres

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

2 vues (au cours des 30 derniers jours)
Scott Phillips
Scott Phillips le 3 Nov 2017
Commenté : Leon Gosh le 19 Nov 2023
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?

Réponses (1)

Roger Stafford
Roger Stafford le 3 Nov 2017
mx = max(reshape(M,10,[]),[],1);

Catégories

En savoir plus sur Loops and Conditional Statements dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by