Add two lines to a matrix.

10 views (last 30 days)
Hello good day.
I have the following matrix
A = [1 1 1 1
         2 2 2 2
         3 3 3 3];
What instruction or how do I add two more lines
equal to the third line, that is, it looks like this
A = [1 1 1 1
         2 2 2 2
         3 3 3 3
         3 3 3 3
         3 3 3 3];
Waiting for your valuable help
Regards

Accepted Answer

Matt J
Matt J on 3 Dec 2019
A=A([1;2;3;3;3],:)
  1 Comment
Ricardo Gutierrez
Ricardo Gutierrez on 3 Dec 2019
Excellent !!!!
It worked
Thank you

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!

Translated by