Draw the minimal value from the plot

3 ビュー (過去 30 日間)
Mateusz
Mateusz 2011 年 3 月 23 日
Let assume we have plot of some function (actually we have plot of the function-values at some sample points). Is it possible to get the minimal function-value from this plot?
Update (better description): I have figure (.fig file) of the plot of some function and I would like to obtain the minimal function-value from the plot in this figure.
Currently I am trying something like that: fighandler = openfig( inName ); yData = get( fighandler, 'YData' );
However, it doesn't work.

採用された回答

Paulo Silva
Paulo Silva 2011 年 3 月 23 日
h=plot(0,0); %any plot will do
ydata=get(h,'YData');
min(ydata)
%draw a horizontal line with y that minimum
line(get(gca,'Xlim'),[min(ydata) min(ydata)])
  3 件のコメント
Paulo Silva
Paulo Silva 2011 年 3 月 23 日
the figure itself doesn't contain ydata, you must look for it
try this:
get(get(gca,'children'),'Ydata')
Mateusz
Mateusz 2011 年 3 月 23 日
It works, thanks.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeEnvironment and Settings についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by