manpagez: man pages & more
info mathgl
Home | html | info | man
[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.18 Rearrange data (MGL)

MGL command: rearrange dat mx [my=0 mz=0]

Rearrange dimensions without changing data array so that resulting sizes should be mx*my*mz < nx*ny*nz. If some of parameter my or mz are zero then it will be selected to optimal fill of data array. For example, if my=0 then it will be change to my=nx*ny*nz/mx and mz will be 1.

MGL command: extend dat n1 [n2=0]

Increase the dimensions of the data by inserting new (|n1|+1)-th slices after (for n1>0) or before (for n1<0) of existed one. It is possible to insert 2 dimensions simultaneously for 1d data by using parameter n2. Data to new slices is copy from existed one. For example, for n1>0 new array will be a_ij^new = a_i^old where j=0...n1. Correspondingly, for n1<0 new array will be a_ij^new = a_j^old where i=0...|n1|.

MGL command: transpose dat ['dim'='yxz']

Transposes (shift order of) dimensions of the data. New order of dimensions is specified int string dim. This command may be useful also for the reading of one-dimensional data.

MGL command: squeeze dat rx [ry=1 rz=1 sm=off]

Reduces the data size by excluding data elements which indexes are not divisible by rx, ry, rz correspondingly. Parameter sm set to use smoothing (i.e. out[i]=\sum_{j=i}^{i+r} a[j]/r) or not (i.e. out[i]=a[j*r]).

MGL command: crop dat n1 n2 'dir'

Cuts off edges of the data i<n1 and i>n2 if n2>0 or i>n[xyz]-n2 if n2<=0 along direction dir.

MGL command: delete dat

Deletes variable dat and makes its memory free. Can be useful for huge data arrays.

MGL command: delete dat 'dir' [pos=off num=0]

Delete num slices along dir-direction at position pos.

MGL command: insert dat 'dir' [pos=off num=0]

Insert num slices along dir-direction at position pos.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]
© manpagez.com 2000-2024
Individual documents may contain additional copyright information.