How can I add a column of zeros to a magic 5x5 matrix A to create a 5x6 matrix C?
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Kristopher
il 17 Giu 2014
Commentato: Kristopher
il 17 Giu 2014
How can I add a column of zeros to a magic 5x5 matrix A to create a 5x6 matrix C? The element value in the 6th column should all be zero.
0 Commenti
Risposta accettata
Image Analyst
il 17 Giu 2014
Modificato: Image Analyst
il 17 Giu 2014
Try this:
A = magic(5)
C = A; % Initialize a brand new matrix called C that is the same as A.
C(5,6) = 0 % Add column 6 that is all zeros.
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Operating on Diagonal Matrices 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!