选取数组最大列。

有一个N行M列的数组 A,实际M大小未知
现在想把数组 A 的2:M列数据放入空数组 B 中2:N列中
B(:,2:end) = A(:,2:end)
问题出在 B 的end里,会提示 “end 运算符必须用在数组索引表达式中”。
除了先 size(A),获取A 的列数这个方法,
请问 B(:,2:end) 中的end有别的表达方式吗?

 采纳的回答

aldiarg
aldiarg 2023-5-16

0 个投票

仅供参考,题目中应该是现在想把数组 A 的2:M列数据放入空数组 B 中2:M列中
B(:,2:size(A,2)) = A(:,2:end);

更多回答(0 个)

类别

帮助中心File Exchange 中查找有关 Logical 的更多信息

产品

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!