How to create a mesh grid point in MatLab - meshgrid -- MatLab
How to create a mesh grid point in MatLab - meshgrid -- MatLab Here is my code and results about meshgrid. %meshgrid_example clear clc x = 1:3; y = 1:5; [X,Y] = meshgrid(x,y) %{ X = 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 Y = 1 1 1 2 2 2 3 3 3 4 4 4 5 5 5 %} "1\n" x = 1:3; y = 1:5; [X,Y]=meshgrid(x) %similar to %[X,Y]=meshgrid(x,x) %{ X = 1 2 3 1 2 3 1 2 3 Y = 1 1 1 2 2 2 3 3 3 %} "2\n" x = 1:3; y = 1:5; z = 1:4; [X,Y,Z]=meshgrid(x,y,z) %{ X(:,:,1) = 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 X(:,:,2) = 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 X(:,:,3) = 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 X(:,:,4) = 1...