Date: Jul 20, 2013 7:18 PM
Author: eziwarman
Subject: Re: compose matrix

"Nasser M. Abbasi" wrote in message <kscr9e$ks2$1@speranza.aioe.org>...
> On 7/19/2013 7:44 PM, eziwarman wrote:
> > hi guys,
> > I am having a bit fuzzy to loop the matrix
> >
> > say you have the matrix (1x4)
> > u=[0 -5 0 5 0]
> > and construct the matrix into (4x10)
> > y=[0 -5 0 5 0 0 0 0 0 0;...
> > 0 0 0 -5 0 5 0 0 0 0;...
> > 0 0 0 0 0 -5 0 5 0 0;...
> > 0 0 0 0 0 0 0 -5 0 5];
> >
> > Thanks
> >

>
> why not make a simple loop and do in the loop?
> you have one row vector, and want to make matrix of
> 4 rows. Simply preallocate the matrix, and make
> a for loop and stick each row in the right location.
>
> Give it a try, and if stuck, will help.
>
> I do not know if there is a direct function in Matlab, since
> blkdiags() does not support an offeset and hence will not
> do what you want.
>
> --Nasser
>

Thanks
could you give me a sample
i am a new learner with matlab

Thanks