Path: news.mathworks.com!not-for-mail
From: "burcu " <burcu102@hotmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: how to create a new matrix from a [n 1] matrix
Date: Thu, 12 Nov 2009 17:40:22 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 29
Message-ID: <hdhha6$o4r$1@fred.mathworks.com>
References: <hdhfbn$m36$1@fred.mathworks.com> <hdhg0a$2ke$1@fred.mathworks.com>
Reply-To: "burcu " <burcu102@hotmail.com>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1258047622 24731 172.30.248.37 (12 Nov 2009 17:40:22 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 12 Nov 2009 17:40:22 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1870888
Xref: news.mathworks.com comp.soft-sys.matlab:584643


Thanks Dips, exactly what i want.
Burcu

"Dips Bhatia" <deepakdbhatia@gmail.com> wrote in message <hdhg0a$2ke$1@fred.mathworks.com>...
> "burcu " <burcu102@hotmail.com> wrote in message <hdhfbn$m36$1@fred.mathworks.com>...
> > Hi all,
> > 
> > I have a nx1 matrix and i want to create an axb matrix from this lines by taking the first a columns and setting as column 1, taking next a columns and putting it right of the first a columns etc. 
> > An example to be more clear:
> > 
> > data= a
> >          b
> >          c
> >          d
> >          e
> >          f
> >          g
> >          h
> > i have 8x1 matrix and i need to get a 2x4 matrix from this like:
> >              a c e g
> >              b d f h
> > Any advice to create such a matrix for a really big number of n?
> > 
> > Thanks for all the replays!
> > 
> > Burcu
> 
> Use reshape(data,2,4)
> See help reshape