Determine the X coordinate in the 2D plot???
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Nitesh
el 12 de Sept. de 2015
Comentada: Nitesh
el 12 de Sept. de 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.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/148952/image.png)
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.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/148954/image.png)
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.
0 comentarios
Respuesta aceptada
Geoff Hayes
el 12 de Sept. de 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.
Más respuestas (0)
Ver también
Categorías
Más información sobre Clocks and Timers en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!