PATTERN

Syntax: | `GRID\PATTERN x y z m GRID\PATTERN\XYOUT x y z m xout yout`
Qualifiers: | `\XYOUT`
Defaults: | `\-XYOUT`

Suppose the vectors `x` and `y` have length `h`, and suppose that for some `n1` and `n2`, `x` and `y` have the following pattern:

`x[1]` | `= x[2]` | `= ... = x[n2],`
`x[n2+1]` | `= x[n2+2]` | `= ... = x[n2+n2],`
`......` |  |
`x[(n1-1)*n2+1]` | `= x[(n1-1)*n2+2]` | `= ... = x[n1*n2]`
`y[1]`
| `= y[n2+1]` | `= ... = y[(n1-1)*n2+1],`
`y[2]` | `= y[n2+2]` | `= ... = y[(n1-1)*n2+2],`
`......` |  |
`y[n2]` | `= y[n2+n2]` | `= ... = y[n1*n2]`

where `h = n1*n2`. If the `x` and `y` vectors have this form, the matrix is constructed, without interpolation, with `n2` rows and `n1` columns, i.e., `m[i,j]=z[k]` where `k=j+(i-1)*n1` for `i=1,2,...,n2` and for `j=1,2,...,n1`.

XYOUT

Syntax: | `GRID\PATTERN\XYOUT x y z m xout yout`

If output vectors, `xout` and `yout`, are desired, you must use the `\XYOUT` qualifier. The coordinates of output matrix element `m[i,j]` will be `(xout[j],yout[i])`, where `xout` contains the x-coordinates of each column and `yout` contains the y-coordinates of each row. If the output matrix has `n1` columns and `n2` rows, then the length of `xout` will be `n1` and the length of `yout` will be `n2`.

`xout = [ x[1]; x[n2+1]; ...; x[(n1-1)*n2+1] ]`
`yout = [ y[1]; y[2]; ...; y[n2] ]`

Example

Suppose: | `X = [ 1; 1; 1; 1; 2; 2; 2; 2; 3; 3; 3; 3 ]`
| `Y = [ 1; 2; 3; 4; 1; 2; 3; 4; 1; 2; 3; 4 ]`
| `Z = [ 1; 2; 3; 4; 5; 6; 7; 8; 9; 10; 11; 12 ]`

After the command: `GRID\PATTERN\XYOUT X Y Z M XOUT YOUT`

          | 1  5   9 |
     M =  | 2  6  10 |, XOUT = [ 1; 2; 3 ], YOUT = [ 1; 2; 3; 4 ]
          | 3  7  11 |
          | 4  8  12 |

INTERPOLATE
INDICES