creating a new matrix from an obtained matix?
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hello. If I already have a matrix [1 2 3; 4 5 6; 7 8 9], how can I add 0 to its every row by a command?
Thank you.
0 commentaires
Réponses (2)
Alan Stevens
le 15 Août 2020
Something like:
M = [1 2 3; 4 5 6; 7 8 9];
Mplus = [M zeros(3,1)]
Mplus =
1 2 3 0
4 5 6 0
7 8 9 0
Alwys assuming you want the zeros as the last column.
0 commentaires
Voir également
Catégories
En savoir plus sur Matrices and Arrays dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!