Re: swapping dimensions [message #41149] |
Wed, 29 September 2004 06:10 |
Karsten Rodenacker
Messages: 98 Registered: July 1997
|
Member |
|
|
Perhaps
; a = array [a,b,c,d]
; x = array [a,b,d,c]
x=transpose(a,[0,1,3,2])
will do it.
Karsten
On Wed, 29 Sep 2004 14:59:30 +0200, maarten <user@domain.invalid> wrote:
> Hello,
>
> Is there a fast way to 'swap' dimensions of an array. Say I have an
> array [a,b,c,d], and I would like to transform it into [a,b,d,c].
> I know I can do this in a for loop using a temporary variable, but isn't
> there a commamd that does this?
>
> thanks in advance, maarten
>
--
Karsten Rodenacker
------------------------------------------------------------ -------- :-)
GSF - Forschungszentrum Institute of Biomathematics and Biometry
D-85758 Oberschleissheim Postfach 11 29
Karsten._R_odenacker@gsf.de | http://ibb.gsf.de/ | DEL _ for reply
http://ibb.gsf.de/homepage/karsten.rodenacker/
Tel: +49 89 31873401 | FAX: ..3369
|
|
|