What should I do to add a new row and a new column to a matrix?
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
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 Commenti
Risposta accettata
Più risposte (1)
Andrei Bobrov
il 20 Set 2013
Modificato: Andrei Bobrov
il 20 Set 2013
if you have Image Processing Toolbox
N = padarray(M,[1 1]);
0 Commenti
Vedere anche
Categorie
Scopri di più su Read, Write, and Modify Image 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!