Labfans是一个针对大学生、工程师和科研工作者的技术社区。 论坛首页 | 联系我们(Contact Us)
MATLAB爱好者论坛-LabFans.com
返回   MATLAB爱好者论坛-LabFans.com > 工程数学软件 > MATLAB论坛
MATLAB论坛 一切MATLAB相关问题在此讨论。
回复
 
主题工具 显示模式
旧 2015-12-31, 15:00   #1
lijiaxin0932
初级会员
 
注册日期: 2015-12-31
年龄: 32
帖子: 1
声望力: 0
lijiaxin0932 正向着好的方向发展
灯泡 使用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

返回错误为:
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);


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


望各位大神解答~~~
lijiaxin0932 当前离线   回复时引用此帖
回复

主题工具
显示模式

发帖规则
不可以发表新主题
不可以发表回复
不可以上传附件
不可以编辑自己的帖子

启用 BB 代码
论坛启用 表情符号
论坛启用 [IMG] 代码
论坛禁用 HTML 代码



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


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