I have some data inside MATLAB. On the picture you can see a small portion:-
The numbers I'm interested in are RPM and Lambda. As you can see, they are neither strictly decreasing or increasing (they are non-linear so to speak). I want to find the average Lambda value in RPM intervals, like from 250-500, 500-750, 1000-1250 and so on. But I don't know how to write such code in MATLAB and the reason is that I won't know at what index this will happen, because the RPM numbers aren't strictly decreasing/increasing.
while RPM >= 1000 && RPM < 1250
Lambda_avg = sum of Lambda values in interval / number of Lambdas in interval
end
while RPM >= 1250 && RPM < 1500
...
end
I could maybe sort the RPM-column from lowest to highest, and then also sort the Lambda-column accordingly, although I'm not sure how to do that either.
Is there any way I can find the average lambda-value in a certain RPM interval across all of the data? I hope my question is clear enough.