# meshgrid

Construct a grid of points from coordinate vectors.

## Syntax

[xx, yy] = meshgrid(x)

[xx, yy] = meshgrid(x, y)

[xx, yy, zz] = meshgrid(x)

[xx, yy, zz] = meshgrid(x, y, z)

## Inputs

x, y, z
Coordinate vectors from which to construct a grid.
Type: double | integer
Dimension: scalar | vector | matrix

## Outputs

xx
The matrix of the x-axis coordinates.
yy
The matrix of the y-axis coordinates.
zz
The matrix of the z-axis coordinates.

## Examples

One input 2D example.

x = [1:3];
[xx yy] = meshgrid(x)
xx = [Matrix] 3 x 3
1 2 3
1 2 3
1 2 3
yy = [Matrix] 3 x 3
1 1 1
2 2 2
3 3 3

Two input 2D example:

x = [1:3];
y = [5:8];
[xx yy] = meshgrid(x, y)
xx = [Matrix] 3 x 3
1 2 3
1 2 3
1 2 3
yy = [Matrix] 4 x 3
5 5 5
6 6 6
7 7 7
8 8 8