Putting 1 around the matrix
1 回表示 (過去 30 日間)
古いコメントを表示
Hi I have a 3X3 matrix and want to put 1 around the matrix as it will become 4X4 matrix.....
3 件のコメント
採用された回答
Andrei Bobrov
2016 年 9 月 23 日
Let A - your matrix [3 x 3]:
A = magic(3);
out = ones(2 + size(A));
out(2:end-1,2:end-1) = A;
参考
カテゴリ
Help Center および File Exchange で Logical についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!