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
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
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

hi,
the problem is that i have the data on fig format on matlab, and i want to convert it to excel format. i changed some of the variables and than i get the next error.
>> f = open('Al015Tantalum.fig'); >> a= get(f, 'children')
a =
477.0011
431.0011
418.0011
>> b= get(a(2), 'children')
b =
435.0012
434.0012
433.0012
>> x = get(b,'XData') ??? Error using ==> get Invalid property found. Object Name : text Property Name : 'XData'.
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.
hi, The only problem is that i have a lot of data on x and y values, something like 16,000 values, so how can i exam which has values on b and which not?
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.
thank you very much for your time and help. the problem with the figure file was that it contained data on the picture and i guess the matlab took it into account..

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Cell Arrays에 대해 자세히 알아보기

질문:

2013년 2월 23일

Community Treasure Hunt

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

Start Hunting!

Translated by