我在 MATLAB 中有一个图像的轮廓数据结构。如下:
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
我必须将 s(k).xdata 和 s(k).ydata 提取到可变大小的矩阵中。这是我制作的程序
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
???错误:用于多个 LHS 分配的数组不能包含数值
谁能帮我?非常感谢您!