MATLAB: Plotting problem & Does the matlab can plot raster map

MATLAB

I have coordinates (X,Y) and its corresponding value (Z), How to visualize them and distinguish with different color for each point? Just like a raster file that every pixel has a value in it.
Thank you very much!

Best Answer

Let X,Y,Z be your m*3 data.
x = unique(X) ; nx = length(x) ;
y = unique(X) ; ny = length(y) ;
X = reshape(X,nx,ny) ;
Y = reshape(Y,nx,ny) ;
Z = reshape(Z,nx,ny) ;
figure
pcolor(X,Y,Z)
shading interp
figure
surf(X,Y,Z)
shading interp