how to add a row to a matrix?
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
A=[1;2;3;4;5]
i wanna add 0 to n row..i tried A(n, :) = 0...but i get this A=[0;2;3;4;5] instead of A=[0;1;2;3;4;5]
what's the problem?
0 commentaires
Réponse acceptée
KSSV
le 11 Jan 2022
Modifié(e) : KSSV
le 11 Jan 2022
Note that you want to append zero before to the first element of A. What you did is replace the first element of A with 0.
A=[1;2;3;4;5] ;
A = [0;A]
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Resizing and Reshaping Matrices 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!