Add two lines to a matrix.

3 vues (au cours des 30 derniers jours)
Ricardo Gutierrez
Ricardo Gutierrez le 3 Déc 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

Réponse acceptée

Matt J
Matt J le 3 Déc 2019
A=A([1;2;3;3;3],:)
  1 commentaire
Ricardo Gutierrez
Ricardo Gutierrez le 3 Déc 2019
Excellent !!!!
It worked
Thank you

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Matrices and Arrays dans Help Center et File Exchange

Produits


Version

R2014a

Community Treasure Hunt

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

Start Hunting!

Translated by