From: Sebastian on 31 Mar 2010 20:08 Hi, I have a multidimensional numerical Array A(38,11,188) that I would like to transfrom into a Matrix B(7144,11). Basically what I want to do is concatenate each "page" of the array into one big Matrix. I saw in the help that for structural arrays one can do that easily, but I have no idea how to do it for numerical arrays. Any help will be more than welcomed, Sebastian
From: Matt Fig on 31 Mar 2010 20:15 See the RESHAPE function.
From: Walter Roberson on 31 Mar 2010 20:17 Sebastian wrote: > I have a multidimensional numerical Array A(38,11,188) that I would like > to transfrom into a Matrix B(7144,11). Basically what I want to do is > concatenate each "page" of the array into one big Matrix. reshape(permute(B,[1 3 2]),[],size(B,2)) But you will want to double-check that this gets the rows in the order that you want.
From: Sebastian on 1 Apr 2010 09:25 Walter Roberson <roberson(a)hushmail.com> wrote in message <hp0omv$jdj$1(a)canopus.cc.umanitoba.ca>... > Sebastian wrote: > > > I have a multidimensional numerical Array A(38,11,188) that I would like > > to transfrom into a Matrix B(7144,11). Basically what I want to do is > > concatenate each "page" of the array into one big Matrix. > > reshape(permute(B,[1 3 2]),[],size(B,2)) > > But you will want to double-check that this gets the rows in the order > that you want. Walter, thank you so much, it worked perfectly.
|
Pages: 1 Prev: Transformation for combining data sets Next: How to read a text (txt) file, modify and save |