Finding the location of particular value

3 views (last 30 days)
Hello
I have a matlab data file which has 4 variables like time,velocity ,acceleration . Each variable has 2000values . I need maximum acceleration,so I used max(acceleration).Now I need to know the velocity at maximum acceleration from the data. How to get that value .

Accepted Answer

Walter Roberson
Walter Roberson on 15 Feb 2020
Edited: Walter Roberson on 15 Feb 2020
[maxacc, maxaccidx] = max(acceleration);
maxaccvel = velocity(maxaccidx);
  4 Comments
Walter Roberson
Walter Roberson on 15 Feb 2020
The second output of max is the index where the data was located.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!