Display the terminal value on the plot

Suppose I have a plot
x=1:0.01:10;
y=x+1;
plot(x,y)
Then I want to have a terminal value of y on the plot like "the terminal value of y is 11." Please advise.

 采纳的回答

Try this:
x=1:0.01:10;
y=x+1;
plot(x,y)
text(x(end), y(end), sprintf('Terminal value of y is %.0f \\rightarrow', y(end)), 'HorizontalAlignment','right')
ylim([min(ylim) 1.1*max(ylim)])
.

更多回答(0 个)

类别

在 帮助中心 和 File Exchange 中查找有关 Logical 的更多信息

产品

版本

R2020a

标签

Community Treasure Hunt

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

Start Hunting!

Translated by