MATLAB爱好者论坛-LabFans.com

MATLAB爱好者论坛-LabFans.com (https://www.labfans.com/bbs/index.php)
-   MATLAB论坛 (https://www.labfans.com/bbs/forumdisplay.php?f=6)
-   -   [MATLAB基础] 使用intersect返回错误 (https://www.labfans.com/bbs/showthread.php?t=20885)

lijiaxin0932 2015-12-31 15:00

使用intersect返回错误
 
各位大神,我的程序如下:
[m,n] = size(DTI);
share=zeros(m);

for ii=1:m-1
for jj=ii+1:m
a=DTI(ii,:);
b=DTI(jj,:);
a(cellfun('isempty',a))=[];
b(cellfun('isempty',b))=[];
c=intersect(a,b);
if length(c)>=1
d=length(c);
share(ii,jj)=d;
share(jj,ii)=d;
end
end
end

[COLOR="Red"][B]返回错误为:
Error using cell/intersect>cellintersectlegacy (line 158)
Input A of class cell and input B of class cell must be cell arrays of strings, unless one is a string.

Error in cell/intersect (line 91)
[varargout{1:nlhs}] = cellintersectlegacy(varargin{:});

Error in ATC (line 10)
c=intersect(a,b);[/B][/COLOR]

我的DTI内容大致如下:
872 423 580 530 523 841 4098 4100
193 [] [] [] [] [] [] []
466 610 295 357 592 [] [] []
872 423 580 530 523 841 947 4095
[] [] [] [] [] [] [] []
[] [] [] [] [] [] [] []


望各位大神解答~~~


所有时间均为北京时间。现在的时间是 13:30

Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.