0
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
I는 반드시는 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 할당에 대한 배열에 숫자 값을 포함 할 수 없습니다.
아무도 도와 줄 수 있습니까? 미리 감사드립니다.
도움을 주셔서 감사합니다. –