2D plot

4 次查看(过去 30 天)
Tallha Akram
Tallha Akram 2012-5-1
I have let 4 entries.
x=[1 2 3 4]
y=[-1 2 -3 -4]
i want to plot x and y. let plot(x,y,' * ');
but i need the index number with each ' * '. If i plot [3; -3], then with ' * ' i must be given index number 3.on the plot window.
index=[1 2 3 4] , for 4 points of x and y.

采纳的回答

Richard
Richard 2012-5-1
Are you thinking of something like this?
clear all
x=[1,2,3,4];
y=[-1,2,-3,-4];
strValues = num2str([x(:) y(:)],'(%d,%d)');
plot(x,y,' * ');
text(x,y,strValues,'VerticalAlignment','bottom');
  1 个评论
Tallha Akram
Tallha Akram 2012-5-1
You have given me clue. thanks .

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Annotations 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by