Borrar filtros
Borrar filtros

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

1 visualización (últimos 30 días)
Nitesh
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.
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.

Respuesta aceptada

Geoff Hayes
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.
  1 comentario
Nitesh
Nitesh el 12 de Sept. de 2015
Thank you so much.
This command stores the value for me to use it further into my program. Thanks.
Nitesh.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Physics en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by