MTH 643
MTH 643
INPUT:
syms x
f=tan(x)-sin(x)+3*x;
g=exp(-x)+x^3;
ezplot(f,[0,4])
hold on;
g=exp(-x)+x^3;
ezplot(g,[0,4])
hold off;
xlabel('0\leq x\leq 4')
title('graph of multiple curves')
legend('tanx-sinx+3x','exp(-x)+x^3')
OUTPUT:
plot the multiple curves of the function
cos x e3 x and e x x 2 3 on the
ii) int erval 0, 2 , with increment 0.002.
label x axis with 0 x 2
INPUT:
x=0:0.002:2;
f=cos(x)-exp(3.*x);
g=exp(-x)+x.^2+3;
plot(x,f,'r')
hold on;
plot(x,g,'g')
hold off;
xlabel('0\leq x\leq 2')
title('graph of multiple curves')
legend('cosx-exp(3*x)','exp(-x)+x^2+3')
OUTPUT:
plot the multiple curves of the function
cos x and e x tan( x) on the
int erval , , with increment pi / 10
iii)
u sin g hold on hold off command
label x axis with x
INPUT:
x=-pi:pi/100:pi;
f=cos(x);
g=exp(-x)+tan(x);
plot(x,f,'g')
hold on;
plot(x,g,'y')
hold off;
xlabel('-\pi\leq x\leq \pi')
title('graph of multiple curves')
legend('cosx','exp(-x)+tanx')
OUTPUT: