0% found this document useful (0 votes)
498 views4 pages

MTH 643

The document contains 3 sections that provide MATLAB code to plot multiple curves on different intervals. Section 1 plots tan(x)-sin(x)+3x and exp(-x)+x^3 on the interval [0,4]. Section 2 plots cos(x)-exp(3x) and exp(-x)+x^2+3 on the interval [0,2] with increment 0.002. Section 3 plots cos(x) and exp(-x)+tan(x) on the interval [−π,π] with increment π/10. All sections label the x-axis and provide legends for the curves.

Uploaded by

Muhammad Farhan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
498 views4 pages

MTH 643

The document contains 3 sections that provide MATLAB code to plot multiple curves on different intervals. Section 1 plots tan(x)-sin(x)+3x and exp(-x)+x^3 on the interval [0,4]. Section 2 plots cos(x)-exp(3x) and exp(-x)+x^2+3 on the interval [0,2] with increment 0.002. Section 3 plots cos(x) and exp(-x)+tan(x) on the interval [−π,π] with increment π/10. All sections label the x-axis and provide legends for the curves.

Uploaded by

Muhammad Farhan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

plot the multiple curves of the function

tan  x   sin  x   3 x and e  x  x 3 on the


i) int erval  0, 4 , u sin d ezplot command .
label x axis with 0  x  4

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:

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy