How to Find Range of Values Between Point A and B

1 回表示 (過去 30 日間)
Adnan Ali
Adnan Ali 2014 年 8 月 1 日
コメント済み: Michael Haderlein 2014 年 8 月 6 日
I want to get the all values Between A and B points.
Background Scenario of Figure: This Figure is output of a Drawn shape/polyline. When I Draw a Shape on Canvas. Values of those points (covered by mouse/stylus) passed to plot and this fig is output.
But here i Want to use this fig as input and want to get values in output.
Note: Point B is not Fixed and also A and B are not the Part of Figure. I drew them in Photoshop to make question clear.

採用された回答

Michael Haderlein
Michael Haderlein 2014 年 8 月 1 日
Not sure if I understand your question: Do you have all t and y data available and want to get only the y data between two t values? Or do you need to extract the t and y data from a figure?
If first case:
tA=0;tB=1500;
yinterval=y(t>=tA & t<=tB);
If second case: Load the figure, then
hc=get(gca,'children');
data=get(hc,{'xdata','ydata'});
t=data{1};
y=data{2};
and proceed as in the first case.

その他の回答 (1 件)

Adnan Ali
Adnan Ali 2014 年 8 月 4 日
I want to extract the t and y data from a figure. (2nd Scenario) I will check the code will comment later. now i have Exam. Thanks for Your Help. :)
  1 件のコメント
Michael Haderlein
Michael Haderlein 2014 年 8 月 6 日
Ok, second case. There's another way to get data from a figure if you actually don't want to display it. You can find it here: http://undocumentedmatlab.com/blog/fig-files-format

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

カテゴリ

Help Center および File ExchangeLegend についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by