returns 2-D grid coordinates based on the coordinates contained in vectors
[X
,Y
] = meshgrid(x
,y
)x
andy
.X
is a matrix where each row is a copy ofx
, andY
is a matrix where each column is a copy ofy
. The grid represented by the coordinatesX
andY
haslength(y)
rows andlength(x)
columns.
meshgrid用于生成二维栅格化坐标,生成的X每一行都由x组成,Y同理。
% x0=repmat(x0line,[iy 1]);
% y0=repmat(y0line,[1 ix]);
[x0,y0]=meshgrid(x0line,y0line);
meshgrid可以替换由repmat写的两行程序。