How to add rows in the middle of a matrix

7 views (last 30 days)
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 Comments
Rik
Rik on 8 Sep 2020
What did you try? This is quite a basic Matlab operation. Did you do a toturial?
Vishnu Pendri
Vishnu Pendri on 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

Sign in to comment.

Accepted Answer

Matt J
Matt J on 8 Sep 2020
Edited: Matt J on 8 Sep 2020
newVector = vertcat( yourVector(1:j-1), sixrows(:), yourVector(j:end) )

More Answers (0)

Products


Release

R2019a

Community Treasure Hunt

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

Start Hunting!