Determine the X coordinate in the 2D plot???
2 次查看(过去 30 天)
显示 更早的评论
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.
0 个评论
采纳的回答
Geoff Hayes
2015-9-12
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.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Clocks and Timers 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!