How to add rows in the middle of a matrix

5 vues (au cours des 30 derniers jours)
Vishnu Pendri
Vishnu Pendri le 8 Sep 2020
Commenté : Vishnu Pendri le 8 Sep 2020
I have a 1439 by 1 matrix full of doubles that contain numbers. Essentially I want to add 6 rows starting a certain index but I am not sure how I can do this.
  2 commentaires
Rik
Rik le 8 Sep 2020
What did you try? This is quite a basic Matlab operation. Did you do a toturial?
Vishnu Pendri
Vishnu Pendri le 8 Sep 2020
I managed to add rows but I kept missing values. Also, whatever I was doing just seemed way too tedious to use in the for loop I was running so I wanted to see if there was a different way to do it

Connectez-vous pour commenter.

Réponse acceptée

Matt J
Matt J le 8 Sep 2020
Modifié(e) : Matt J le 8 Sep 2020
newVector = vertcat( yourVector(1:j-1), sixrows(:), yourVector(j:end) )

Plus de réponses (0)

Catégories

En savoir plus sur Matrix Indexing dans Help Center et File Exchange

Produits


Version

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by