Putting 1 around the matrix
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Offroad Jeep
am 23 Sep. 2016
Kommentiert: Offroad Jeep
am 23 Sep. 2016
Hi I have a 3X3 matrix and want to put 1 around the matrix as it will become 4X4 matrix.....
3 Kommentare
Akzeptierte Antwort
Andrei Bobrov
am 23 Sep. 2016
Let A - your matrix [3 x 3]:
A = magic(3);
out = ones(2 + size(A));
out(2:end-1,2:end-1) = A;
Weitere Antworten (1)
Siehe auch
Kategorien
Mehr zu Image Processing Toolbox finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!