Putting 1 around the matrix
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Offroad Jeep
il 23 Set 2016
Commentato: Offroad Jeep
il 23 Set 2016
Hi I have a 3X3 matrix and want to put 1 around the matrix as it will become 4X4 matrix.....
3 Commenti
Risposta accettata
Andrei Bobrov
il 23 Set 2016
Let A - your matrix [3 x 3]:
A = magic(3);
out = ones(2 + size(A));
out(2:end-1,2:end-1) = A;
Vedere anche
Categorie
Scopri di più su Image Processing Toolbox in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!