Add two lines to a matrix.

1 Ansicht (letzte 30 Tage)
Ricardo Gutierrez
Ricardo Gutierrez am 3 Dez. 2019
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

Akzeptierte Antwort

Matt J
Matt J am 3 Dez. 2019
A=A([1;2;3;3;3],:)
  1 Kommentar
Ricardo Gutierrez
Ricardo Gutierrez am 3 Dez. 2019
Excellent !!!!
It worked
Thank you

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Matrices and Arrays finden Sie in Help Center und File Exchange

Produkte


Version

R2014a

Community Treasure Hunt

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

Start Hunting!

Translated by