I have a stucture of contourdata of an image in MATLAB. Is is as follows:
s =
1x59 struct array with fields:
level
numel
xdata
ydata
%s(k).level contains the contour level height of the k-th line.
% s(k).numel contains the number of points describing the k-th line.
% sk).isopen is True if the k-th contour is open and False if it is closed.
% s(k).xdata contains the x-axis data for the k-th line as a column vector.
% s(k).ydata contains the y-axis data for the k-th line as a column vector
I must to extract s(k).xdata and s(k).ydata into matrix with variable size. This is the program i have made
for k=1:59;
if (k==1);
i(k)=s(k).numel;
[i,2]=size(S{k}(:,:));
x=s(k).xdata;
y=s(k).ydata;
S{k}(:,:)=[x y];
elseif (k>1 && k<=59)
i(k)=s(k).numel;
l=i(k-1)+i(k)
[i,2]=size(S{k}(:,:));
x=s(k).xdata;
y=s(k).ydata;
S{k}(:,:)=[x y];
S(:,:)=[S{k-1}(:,:);S{k}(:,:)];
end
end
??? Error: An array for multiple LHS assignment cannot contain numeric value
Can anyone help me? Thank you so much in advance!