Adding a row of ones
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Renea Young
am 20 Nov. 2021
Kommentiert: Renea Young
am 21 Nov. 2021
I want to add a row of ones to the first row of a=[1 2 3 4;5 6 7 8;9 10 11 12; 13 14 15 16]. This 4x4 will become 5x4. Any suggestions?
0 Kommentare
Akzeptierte Antwort
Atsushi Ueno
am 20 Nov. 2021
a = [1 2 3 4;5 6 7 8;9 10 11 12; 13 14 15 16];
b = [ones(1,size(a,2)); a]
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Logical 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!