How do I sum a vector (row) to a matrix?
Ältere Kommentare anzeigen
If I have
A=[1 0 0 1;
-1 0 1 1;
1 1 1 1]
B=[1 2 2 1]
How do I add the vector B to the 1st row of A so I get:
A=[2 2 2 3;
-1 0 1 1;
1 1 1 1]
Akzeptierte Antwort
Weitere Antworten (1)
the cyclist
am 16 Nov. 2021
Bearbeitet: the cyclist
am 16 Nov. 2021
A=[1 0 0 1;
-1 0 1 1;
1 1 1 1];
B=[1 2 2 1];
A(1,:) = A(1,: ) + B
1 Kommentar
JOSUE PÁNCHEZ
am 16 Nov. 2021
Kategorien
Mehr zu Matrix Indexing finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!