Path: news.mathworks.com!newsfeed-00.mathworks.com!newsfeed2.dallas1.level3.net!news.level3.com!postnews.google.com!m3g2000pri.googlegroups.com!not-for-mail
From: Nathan <ngreco32@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Reshape in Row First
Date: Tue, 4 Aug 2009 08:58:48 -0700 (PDT)
Organization: http://groups.google.com
Lines: 51
Message-ID: <4c2a45aa-4e2d-4d62-bb48-3d174470e367@m3g2000pri.googlegroups.com>
References: <ef2cda9.-1@webx.raydaftYaTP> <ef2cda9.0@webx.raydaftYaTP> 
	<h59ld6$ehn$1@fred.mathworks.com>
NNTP-Posting-Host: 198.206.219.33
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-Trace: posting.google.com 1249401528 10744 127.0.0.1 (4 Aug 2009 15:58:48 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Tue, 4 Aug 2009 15:58:48 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: m3g2000pri.googlegroups.com; posting-host=198.206.219.33; 
	posting-account=_KeVcAoAAAB7j3xn35ujaQ0BoQhuzwJP
User-Agent: G2/1.0
X-HTTP-Via: 1.1 wwwproxy-son-ca-01.ca.sandia.gov:80 (squid/2.5.STABLE14)
X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.1) 
	Gecko/20090715 Firefox/3.5.1,gzip(gfe),gzip(gfe)
Xref: news.mathworks.com comp.soft-sys.matlab:560746

On Aug 4, 8:51 am, "Chris " <scu0...@reading.ac.uk> wrote:
> us <u...@neurol.unizh.ch> wrote in message <ef2cda...@webx.raydaftYaTP>...
> > weihua xiong:
> > <SNIP small <reshape> problem...
>
> > one of the solutions
>
> >      m=[1,2,3,4
> >         5,6,7,8]
> >      mr=reshape(m.',1,[])
>
> > us
>
> Hi there I was wondering is there any way of reshaping row by row when you have more than one row, for example i have data:
>
> '512'   '487'   '761'   '503' '513'     '484'   '762'   '495' '514'     '481'.... in a 1x185 array and I want it to go
>
> 512 487 761 503
> 513 484 762 495
> 514 481 ...  in a 4x45number of rows
>
> but i can only get
>
> 512     495     761     483
> 487     512     491     765
> 761     484     515     495
> 503     765     482     513
> 513     478     764     484  in a 4x45
> 484
> 762
> 495
> 514
> 481
>
> any help would be amazing
>
> many thanks Chris


A = [512 487 761 503 513 484 762 496];
B = reshape(A,4,[])';
%%%%%%%%%%%%%%%%%%%%%
B =
   512   487   761   503
   513   484   762   496

-Nathan