What should I do to add a new row and a new column to a matrix?
2 次查看(过去 30 天)
显示 更早的评论
Just ad the title shows, I have a matrix, for example M with the size 3-by-4. The M is [1 2 3 4;5 6 7 8;1 2 3 4]
What should I do if i want to get another matrix ,N like that: [0 0 0 0 0 0; 0 1 2 3 4 0; 0 5 6 7 8 0; 0 1 2 3 4 0; 0 0 0 0 0 0];
0 个评论
采纳的回答
更多回答(1 个)
Andrei Bobrov
2013-9-20
编辑:Andrei Bobrov
2013-9-20
if you have Image Processing Toolbox
N = padarray(M,[1 1]);
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Read, Write, and Modify Image 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!