Contents Previous Next Subchapters

X and Y Grids for Contour and Mesh Plots (Mlmode)
Syntax [XY] = meshgrid(xy)
See Also mlmode_contour , mlmode_mesh

Description
The input vectors x and y specify the 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).

Matrix Types
The vectors x and y can be integer, real or double-precision. The matrices X and Y are always double-precision.

Example
If in Mlmode you enter
     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 ]
     }