clc, clear all, close all

x = input('Input x to compute cosh(x): ');
csh = (exp(x)+exp(-x))/2;
cshm = cosh(x);
disp(['By definition cosh(',num2str(x),')=',num2str(csh)])
disp(['By Matlab     cosh(',num2str(x),')=',num2str(cshm)])

f = @(x) cosh(x);

fplot(f, [-3 3])
title('f(x)=cosh(x) using fplot','fontsize',15)
xlabel('x')
ylabel('y')
axis([-3 3 -1 10])
grid on

%figure
%fplot('cosh(x)',[-10 10])
%ezplot('x^2+y^2-1')

x = linspace(-1,1,1e5);
y = cosh(x);
[Y I]=min(y)
x(I)

%x = fminbnd('cosh(x)',-10,10)
