What should I do to add a new row and a new column to a matrix?
1 回表示 (過去 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!