MATLAB: Display the terminal value on the plot

MATLAB

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.

Best Answer

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)])
.
Related Question