简单的MATLAB。
显示 更早的评论
小白求教
一个5X6阶矩阵,
A=[0,5,0,0,0,0;
0,0,5,5,5,0;
0,0,0,0,0,0;
0,0,0,0,0,0;
0,0,0,0,0,5];
for i=1:5%
for j=1:6%
if A(i,j)>0
M(i)=A(i,j);
end
end
end
想得到M=【5,5,5,5,5】
但是得到M=[5,5,0,0,5],请问哪里出了问题,怎么修改?谢谢
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 MATLAB 快速入门 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!