MATLAB: 2D color plot with 3 vectors

2d plot color

I have three vectors: x, y and z. Each (x(i), y(i)) coordinate corresponds to one z(i). I want to plot a 2D plot with x, y as axes and z denotes the colors. What should I do? Thanks a lot.

Best Answer

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