Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我用
s = cell(4,4);
现在我想编辑两个条目:
s{1,1:2} = ?? //what do I write here?
我尝试了以下方法: s{1,1:2} = {A,B}; s{1,1:2} = {A;B}; s{1,1:2} = {{A},{B}};但它们都不起作用。
它总是说:“这个赋值的右侧的值太少,无法满足左侧的要求。”
我怎样才能做到这一点?
提前致谢!
利用
s(1,1:2) = {A,B};
例子:
>> s(1,1:3) = {'first','second','third'} s = 'first' 'second' 'third' [] [] [] [] [] [] [] [] [] [] [] [] [] >> A=12 A = 12 >> B=4 B = 4 >> s(1,1:2) = {A,B} s = [12] [4] 'third' [] [] [] [] [] [] [] [] [] [] [] [] []