The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Software » comp.soft-sys.matlab

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Insert row in an array and delete last row
Replies: 7   Last Post: Jan 21, 2013 2:38 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Michael Doukas

Posts: 12
Registered: 12/26/12
Insert row in an array and delete last row
Posted: Jan 20, 2013 9:28 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Hello everybody,

I have a script that performs some actions and generates a row vector [1x13].
In a for loop i want to insert this generated row vector as the first row in a matrix L.
L has a preallocated size [150x13].
But i do not want to replace the pre-existing first row. The new row vector must be inserted before the existing first row.

So in that way all rows will be moved downwards one row.

Finally, once this is done, a want to remove the last row, in order to maintain the size of the matrix L.

Thank you,

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.