Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: merging/grouping arrays
Date: Wed, 4 Feb 2009 01:07:02 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 17
Message-ID: <gmapnm$e83$1@fred.mathworks.com>
References: <gmak2b$o8l$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 1233709622 14595 172.30.248.37 (4 Feb 2009 01:07:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 4 Feb 2009 01:07:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1187260
Xref: news.mathworks.com comp.soft-sys.matlab:515854

"Ondrej " <ondrej.muransky@ansto.gov.au> wrote in message <gmak2b$o8l$1@fred.mathworks.com>...
> ......
> I have 3 arrays A, B, C with the same number of elements (76x18) and I need to group the elements with the same indices in the matrix X as follows:
>  
> X = A(1,1) B(1,1) C(1,1) 
>       A(1,2) B(1,2) C(1,2)
>       A(1,3) B(1,3) C(1,3)
>         &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;
>         &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;
>       A(2,1) B(2,1) C(2,1)
>         &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;
>       A76,18) B(76,18) C(76,18) 
> ......

 X = [reshape(A.',[],1),reshape(B.',[],1),reshape(C.',[],1)];

Roger Stafford