Insert values into an array
155 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
A = [1 3 5 6 7 13]
I want to insert 0 in the 1st cell resulting in
A=[0 1 3 5 6 7 13]
Thanks
0 Kommentare
Akzeptierte Antwort
Walter Roberson
am 5 Jul. 2012
A = [0 A]; %build new array
Or:
A(2:end+1) = A; %shift over and zero
A(1) = 0;
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Whos finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!