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: creating a larger matrix from a smaller matrix
Replies: 2   Last Post: Jan 22, 2013 6:52 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Matt J

Posts: 4,997
Registered: 11/28/09
Re: creating a larger matrix from a smaller matrix
Posted: Jan 22, 2013 6:52 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

"Matt J" wrote in message <kdn72u$9on$>...
> "Erick " <> wrote in message <kdn2pu$noq$>...
> > Hello,
> >
> > I have a 10x1 matrix with a bunch of values in each row. I would like to create a 40x1 matrix using the values in each row of the 10x1 matrix. I would like the first value in the 10x1 matrix to be copied 4 times into the second 40x1 matrix and then go to the second cell in the 10x1 matrix and copy that value 4 times in the 40x1 matrix and so on until this has been done for all values in the 10x1 matrix. Please let me know if there is a way to do this. Thank you

> ==================
> A_40x1 = kron(ones(4,1),A_10x1);


A_40x1 = kron( A_10x1 , ones(4,1) );

Hard to tell from your description.

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.