Filter löschen
Filter löschen

Determine the X coordinate in the 2D plot???

1 Ansicht (letzte 30 Tage)
Nitesh
Nitesh am 12 Sep. 2015
Kommentiert: Nitesh am 12 Sep. 2015
Hello
I have performance plot which i need to select the best settling time,rise time and peak OS for step response for my new gain values based on them. Lets say, i wana determine the values of the settling time for a set of simulation using
ts(n-1)=s1.SettlingTime;
where n<=15
yy are the 21 values of iteration. All the settling time are given as yy below.
Now using
ymin=min(ts)
i get the min value of 6.4943 seconds
i can get the minimum time without referring to the plot. which in my plot is also same as in red.The x-axis is the iteration number.. which is 21 iterations (0-20) and y are the different settling time values.
Now my issue is, what command should i use that my program will automatically choose the min value from the Y-axis and determine its cooresponding X-axis (iteration number) so that i can you for next task of my program.
Please help me. Thank you.

Akzeptierte Antwort

Geoff Hayes
Geoff Hayes am 12 Sep. 2015
Nitesh - get the index of the minimum value of y and use that index to access the corresponding iteration. So
[ymin, yminIdx] = min(y);
yminIteration = x(yminIdx);
In the above, I am assuming that x is the corresponding vector with iteration information (and that all values of y are distinct). See min for details on the second output parameter of this function.
  1 Kommentar
Nitesh
Nitesh am 12 Sep. 2015
Thank you so much.
This command stores the value for me to use it further into my program. Thanks.
Nitesh.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Physics finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by