MATLAB: How to change the color of a single point in a scatter plot

colorplotscatter

I am plotting points:
x = [ 1 1 1 1 1 2 2 2 2 2 3 3 3 3 3 4 4 4 4 4 5 5 5 5 5];
y = [ 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5];
plot(x,y,'*')
I would like to change the color of just an individual point, how do I go about it?

Best Answer

x = [ 1 1 1 1 1 2 2 2 2 2 3 3 3 3 3 4 4 4 4 4 5 5 5 5 5];
y = [ 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5];
plot(x,y)
hold on
scatter(x(7),y(7),'r')
hold off