Putting 1 around the matrix
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Offroad Jeep
el 23 de Sept. de 2016
Comentada: Offroad Jeep
el 23 de Sept. de 2016
Hi I have a 3X3 matrix and want to put 1 around the matrix as it will become 4X4 matrix.....
3 comentarios
Respuesta aceptada
Andrei Bobrov
el 23 de Sept. de 2016
Let A - your matrix [3 x 3]:
A = magic(3);
out = ones(2 + size(A));
out(2:end-1,2:end-1) = A;
Más respuestas (1)
Ver también
Categorías
Más información sobre Image Processing Toolbox en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!