Finding the location of particular value

1 visualizzazione (ultimi 30 giorni)
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 .

Risposta accettata

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

Accedi per commentare.

Più risposte (0)

Community Treasure Hunt

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

Start Hunting!

Translated by