MATLAB: How to show the maximum in the graphs

graphmaximumxmax

Hi guys,
I got the maximum of y4, but I don't know how to show it in my graphs.
clear all
close all
x=(0:0.01:80).';
y1=(0.02049/0.4)*x;
y2=(0.53*60./(1+(1.331./(sqrt(0.0631*x./(83.18-x))).^3)));
y3=(0.53*60./(1+(1.331./(sqrt(0.0631*x./(83.18-x))).^3)))-(0.02049/0.4)*x;
y4=(0.02049/0.4)*x-(0.53*60./(1+(1.331./(sqrt(0.0631*x./(83.18-x))).^3)));
figure
plot(x,y1,'r')
hold on
plot(x,y2,'c')
plot(x,y3,'g')
plot(x,y4,'b')
legend('Line1','Line2','Line3','Line4')
axis([0 80 -1 3.5])
x=linspace(0, 80, 200);
y4=@(x) (0.02049/0.4)*x-(0.53*60./(1+(1.331./(sqrt(0.0631*x./(83.18-x))).^3)));
f = y4(x);
[y4Max, iMax] = max(f)
xMax = x(iMax)
Thank you very much

Best Answer

Do you mean like this?
line([xMax xMax],ylim)