|
Contents | Previous | Next | Subchapters |
| Syntax |
[X, Y] = meshgrid(x, y) |
| See Also | mlmode_contour , mlmode_mesh |
x and y grid values for a
mlmode_contour
or mlmode_mesh
plot.
The matrices X and Y are set to have
row dimension equal to the length of y
and column dimension equal to the length of x.
The (i,j)-th element of X is equal to the
value of x(j).
The (i,j)-th element of Y is equal to the
value of y(i).
x = -2 : 1 : +2;
y = -1 : 1 : +1;
[X, Y] = meshgrid(x, y);
X
O-Matrix will print
{
[ -2 , -1 , 0 , 1 , 2 ]
[ -2 , -1 , 0 , 1 , 2 ]
[ -2 , -1 , 0 , 1 , 2 ]
}
If you continue by entering
Y
O-Matrix will respond
{
[ -1 , -1 , -1 , -1 , -1 ]
[ 0 , 0 , 0 , 0 , 0 ]
[ 1 , 1 , 1 , 1 , 1 ]
}