Keywords - Function groups - @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

 Group: Binning, Grids and Sequences See also: bindata aseq conv distance mseq

 Function: grid Description: This command generates a grid with origin x and stepwidth h with respect to each dimension, n indicating the number of gridpoints in the respective dimension.

 Usage: z = grid (x, h, n) Input: x m x 1 x d1 x ... x dn array h m x 1 x d1 x ... x dn array n m x 1 x d1 x ... x dn array Output: z m x (n1*n2*...*nm) x d1 x ... x dn array

Note:
The coordinates of n all have to be greater than 0.

Example:
```x = #(0,   0,   0)
h = #(1, 2, 3)
n = #(2,   2,   2)
z = grid(x,h,n)
sort(z)

```
Result:
```Contents of sort

[1,]        0        0        0
[2,]        0        0        3
[3,]        0        2        0
[4,]        0        2        3
[5,]        1        0        0
[6,]        1        2        0
[7,]        1        2        3
[8,]        1        0        3
```
Example:
```x = #(0,   0,   0)
h = #(0.5, 0.5, 0.5)
n = #(1,   2,   3)
z = grid(x,h,n)
sort(z)

```
Result:
```Contents of sort

[1,]        0      0.5      0.5
[2,]        0        0        1
[3,]        0      0.5        0
[4,]        0        0        0
[5,]        0        0      0.5
[6,]        0      0.5        1
```

(C) MD*TECH Method and Data Technologies, 05.02.2006