Re: [討論] plot 標數字

作者: newton2009 (好瘦唷QQ)   2014-04-17 13:18:14
※ 引述《goldberg73 (高柏)》之銘言:
: 如果一資料 如
: a=10 25 35 45
: 想要畫出其折線圖,有辦法順便在圖上顯示出數值大小嗎??
: 謝謝
a = [10 25 35 45];
x = 1:length(a);
y = a;
figure
plot(x, y, '-')
for i=1:length(a)
text(x(i), y(i), num2str(y(i))) % 可以調整標記的位置!
end
作者: goldberg73 (高柏)   2014-04-17 14:25:00
謝謝!
作者: newton2009 (好瘦唷QQ)   2014-04-18 13:42:00
不會

Links booklink

Contact Us: admin [ a t ] ucptt.com