Contents Previous Next Subchapters Current Chapters-> mlmode_mean mlmode_std mlmode_ellipke mlmode_disp mlmode_warning str2mat int2str mlmode_contour mlmode_mesh mlmode_meshc mlmode_surf mlmode_surfc mlmode_meshgrid mlmode_etime mlmode_finite mlmode_full mlmode_isieee mlmode_isunix mlmode_issparse mlmode_isstr Parent Chapters-> Omatrix6 mlmode mlmode_mfile mlmode_meshgrid Search Tools-> contents reference index search

X and Y Grids for Contour and Mesh Plots (Mlmode)

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 ]
}