MATLAB Answers

Inserting a row and moving other rows down

1 view (last 30 days)
I am trying to insert a row of ones as the new 2nd row to my matrix, but i want ot move the other rows down. My matrix is defined as A =
3 7 6 0
8 2 5 0
0 1 9 0

  0 Comments

Sign in to comment.

Accepted Answer

Ajay Kumar
Ajay Kumar on 29 Jan 2020
Edited: Ajay Kumar on 29 Jan 2020
A = [A(1,:);[1,1,1,1];A(2,:);A(3,:)]

  1 Comment

Sign in to comment.

More Answers (0)

Sign in to answer this question.