Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Reshaping Dataset
Date: Thu, 25 Jun 2009 20:55:02 +0000 (UTC)
Organization: Erasmus MC
Lines: 25
Message-ID: <h20o76$864$1@fred.mathworks.com>
References: <h20j9k$9ok$1@fred.mathworks.com>
Reply-To: <HIDDEN>
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 1245963302 8388 172.30.248.37 (25 Jun 2009 20:55:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 25 Jun 2009 20:55:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 870065
Xref: news.mathworks.com comp.soft-sys.matlab:550728


"Jeremy Bing" <jeremy@mytrashmail.com> wrote in message <h20j9k$9ok$1@fred.mathworks.com>...
> 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.

If I understand this correctly, you need column 4-6 to appear below column 1-3? 

B = [A(:,1:3) ; A(:,4:6)] ;

hth
Jos