MATLAB: 2D scatter plot with Z-value in color

2d plotcolorscale

Hi all,
It’s a basic question but I struggle to find the answer on the Internet…
I have a matrix with x,y and z colum, representing the c-coordinate, the y-coordinate and depth (z).
I’d like to plot (x,y) but that those points show a colorscale depending on the depth value (just the point colors I don’t want an interpolation).
Can somebody help me please?

Best Answer

pointsize = 10;
scatter(x, y, pointsize, z);