Error using ==> get Conversion to double from cell is not possible.
古いコメントを表示
>> f = open('Al015Tantalum.fig'); >> a= get(gca, 'children')
a =
228.0011
174.0011
>> b= get(a, 'children')
b =
[0x1 double]
[0x1 double]
>> x=get(b','xdata') ??? Error using ==> get Conversion to double from cell is not possible.
>> y =get (b, 'YData') ??? Error using ==> get Conversion to double from cell is not possible.
回答 (2 件)
the cyclist
2013 年 2 月 23 日
0 投票
Well, b is empty (because the children of a don't have children, it seems).
So, you are trying to get properties from an empty set. Guessing that's why you got the error.
Youssef Khmou
2013 年 2 月 23 日
編集済み: Youssef Khmou
2013 年 2 月 23 日
hi,
I think you get the error because you use "get" with cell .
IF your variables a and b contains data with same type you can use cell2mat :
example :
b=cell(4); % empty cell
x=get(cell2mat(b),'xdata');
y=get(cell2mat(x),'xdata');
% technically the code is correct but meaningless because it returns empty x
%and y .
ELSE , you can use cell as output:
x{1}=get(b{1},'XData');
y{1}=get({2},'YData');
5 件のコメント
ravit
2013 年 2 月 24 日
the cyclist
2013 年 2 月 24 日
Try looking at each value of b individually. For example, try
>> x = get(b(1),'XData')
My guess is that not every handle in b has XData. You need to find the handle you need.
ravit
2013 年 2 月 24 日
the cyclist
2013 年 2 月 24 日
You don't have to look at all values of x. You just have to look at each of the three values of b, to see which object has XData in it.
ravit
2013 年 2 月 24 日
カテゴリ
ヘルプ センター および File Exchange で Cell Arrays についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!