[X,Y] = meshgrid(x,y) returns 2-D grid coordinates based on the coordinates contained in vectors x and y. X is a matrix where each row is a copy of x, and Y is a matrix where each column is a copy of y. The grid represented by the coordinates X and Y has length(y) rows and length(x) columns.
[X,Y] = meshgrid(x,y)基于向量x和y中包含的坐标返回2-D网格坐标。 X是矩阵,其中每行是x的副本,Y是矩阵,其中每列是y的副本。由坐标X和Y表示的网格具有长度(y)行和长度(x)列。
例如:x = [ 1 2 3] y = [ 4 5 ] 其中x ,y均为行向量。
[X,Y] = meshgrid(x,y)
矩阵X的每一行都是x,一共有length(y)行
即:
X= 1 2 3
1 2 3
矩阵y的每一列都是y,一共有length(x)行
即:
Y =
4 4 4
5 5 5
网友评论