Extracting data from a .fig file
77 ビュー (過去 30 日間)
古いコメントを表示
Wissem-Eddine KHATLA
2023 年 11 月 23 日
コメント済み: Dyuman Joshi
2023 年 11 月 23 日
Hello everyone,
I know this has already been discussed in an another discussion but I want to extract data from a particular figures and I keep having an error while using the habitual procedure :
open('Comparaison R(t) EXP x THE.fig');
a = get(gca,'Children');
xdata = get(a, 'XData');
ydata = get(a, 'YData');
zdata = get(a, 'ZData');
I obtain the following error :
Error using matlab.graphics.primitive.Data/get
Unrecognized property XData for class ConstantLine.
Anyone knows how I can have access to these datas ?
Thanks for your help in advance,
Sincerely
0 件のコメント
採用された回答
Dyuman Joshi
2023 年 11 月 23 日
There are multiple objects in the figure. You need to choose the object(s) for which you want to get the data -
open('Comparaison R(t) EXP x THE.fig')
a = get(gca,'Children')
%x, y and z data for the 2nd graphics object
x2 = a(2).XData
y2 = a(2).YData
z2 = a(2).ZData
2 件のコメント
Dyuman Joshi
2023 年 11 月 23 日
You're welcome!
Also, note that not every graphical object will have coordinate data associated with it.
A ConstantLine object is an example of that -
open('Comparaison R(t) EXP x THE.fig')
a = get(gca,'Children')
get(a(1))
%Though Get the axis and value associated with it
a(1).InterceptAxis
a(1).Value
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Interactive Control and Callbacks についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!