Path: news.mathworks.com!newsfeed-00.mathworks.com!newsfeed2.dallas1.level3.net!news.level3.com!postnews.google.com!p5g2000pre.googlegroups.com!not-for-mail
From: TideMan <mulgor@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Reshaping Dataset
Date: Thu, 25 Jun 2009 15:55:07 -0700 (PDT)
Organization: http://groups.google.com
Lines: 25
Message-ID: <61a279c4-d65c-4336-b78f-bf4cde6dedb2@p5g2000pre.googlegroups.com>
References: <h20j9k$9ok$1@fred.mathworks.com>
NNTP-Posting-Host: 202.78.152.105
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-Trace: posting.google.com 1245970508 23107 127.0.0.1 (25 Jun 2009 22:55:08 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Thu, 25 Jun 2009 22:55:08 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: p5g2000pre.googlegroups.com; posting-host=202.78.152.105; 
	posting-account=qPexFwkAAABOl8VUndE6Jm-9Z5z_fSpR
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.11) 
	Gecko/2009060215 Firefox/3.0.11,gzip(gfe),gzip(gfe)
X-HTTP-Via: 1.1 bc1
Xref: news.mathworks.com comp.soft-sys.matlab:550754


On Jun 26, 7:31 am, "Jeremy Bing" <jer...@mytrashmail.com> wrote:
> Hi,
>
> I have data in the form of the following.
>
> X Y Z X Y Z  >>
> X Y Z X Y Z
> X Y Z X Y Z
> X Y Z X Y Z
> ...
>
> But i need the data to be:
>
> X Y Z
> X Y Z
> X Y Z
>
> Do i used a case statement or a nested forloop to reshape the data? The dataset is quite large.

How about:
A=rand(6,6);
B=zeros(12,3);
B(1:2:end,:)=A(:,1:3);
B(2:2:end,:)=A(:,4:6);