MATLAB Answers

Light

how can i add 2 row

Asked by Light
on 6 Jun 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?

  0 Comments

Products

No products are associated with this question.

1 Answer

Answer by Walter Roberson
on 6 Jun 2013
 Accepted answer
A(FirstRow,:) + A(SecondRow,:)

Or if you want to get fancier,

sum(A([FirstRow, SecondRow],:))

  1 Comment

Light
on 7 Jun 2013

Tnx


Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply today