How to label each data point in a MatLab plot, like the following figure?

MatLab code:
x = [1:10]; y = x + rand(1,10); figure('color','w'); plot(x,y,'o'); a = [1:10]'; b = num2str(a); c = cellstr(b); dx = 0.1; dy = 0.1; text(x+dx, y+dy, c);
It also works on 3D plot:

Perfect answer, thank you
Thanks a lot. Your article helped me.