Azzera filtri
Azzera filtri

how can i add 2 row

6 visualizzazioni (ultimi 30 giorni)
Light
Light il 6 Giu 2013
A=[-1,-1,0,0,0;0,0,0,-1,0;0,1,-1,0,-1;0,0,1,0,0;1,0,0,1,1]
With that matrix how can i add row to row command (code)
And in any kind of matrix?

Risposta accettata

Walter Roberson
Walter Roberson il 6 Giu 2013
A(FirstRow,:) + A(SecondRow,:)
Or if you want to get fancier,
sum(A([FirstRow, SecondRow],:))

Più risposte (0)

Categorie

Scopri di più su Modeling in Help Center e File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by