
帮我看看下面的matlab命令,帮我解析一下什么错误吧,还有那句提醒什么意思,谢谢了
>>A(1,1)={'Anexampleofcellarray'};A(1,2)={[12;34]};A(2,1)=tf(1,[1,8]);A(2,2)={A(1,2);...
>> A(1,1)={'An example of cell array'};
A(1,2)={[1 2;3 4]};
A(2,1)=tf(1,[1,8]);
A(2,2)={A(1,2);'This is an example'};
celldisp(A)
??? Assignment has more non-singleton rhs dimensions than non-singleton
subscripts 展开
A(1,2)={[1 2;3 4]};
A(2,1)=tf(1,[1,8]);
A(2,2)={A(1,2);'This is an example'};
celldisp(A)
??? Assignment has more non-singleton rhs dimensions than non-singleton
subscripts 展开
2个回答
展开全部
第三句中,A(2,1)只能放入一个值,而右侧指定了两个值,第四句也是这个问题。
若要放入多个值,需把该位置定义为cell类型,A{2,1},等式右边直接写需放入的内容,
不需再加{},否则cell的层级关系会变繁复。
A{1,1}='An example of cell array';
A{1,2}=[1 2;3 4];
A{2,1}=tf(1,[1,8]);
A{2,2}=[A(1,2);'This is an example'];
celldisp(A)
若要放入多个值,需把该位置定义为cell类型,A{2,1},等式右边直接写需放入的内容,
不需再加{},否则cell的层级关系会变繁复。
A{1,1}='An example of cell array';
A{1,2}=[1 2;3 4];
A{2,1}=tf(1,[1,8]);
A{2,2}=[A(1,2);'This is an example'];
celldisp(A)
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询