MATLAB: Is there a function to plot the points and display the coordinates of every point in MATLAB 7.8 (R2009a)


I want to plot some data in MATLAB and would like the coordinates of the points to be displayed beside the points in the figure automatically.

Best Answer

The ability to display coordinates of every point in the plot automatically is not available in MATLAB 7.8 (R2009a).
As a workaround, you can loop through the points in the plot and use the TEXT command to display their coordinates. As an example:
a = rand(1,5);
offset = 0.1;
for i=1:length(a)
text(i,a(i),['(' num2str(i),',' num2str(a(i)) ')']);