how to add a row to a matrix?
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
Akzeptierte Antwort
KSSV
am 11 Jan. 2022
Bearbeitet: KSSV
am 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]
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Matrix Indexing finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!