How to draw exponential function in matlab
Afficher commentaires plus anciens
Does anyone know how to draw this function f(x)=sin(x). Exp(-lxl) in Matlab?Thanks.
Réponses (2)
It seems like you listed a couple of functions, were you looking to plot them separately?
Can plot the functions using fplot
nexttile
fplot(@(x)sin(x))
nexttile
fplot(@(x)exp(-abs(x)))
Or plot values using plot
nexttile
x=linspace(-5,5,100);
plot(x,sin(x))
nexttile
plot(x,exp(-abs(x)))
8 commentaires
Chris Lin
le 7 Août 2021
Chris Lin
le 7 Août 2021
I'm not sure what 'merge it' means...on the same axes?
fplot(@(x)sin(x))
hold on
fplot(@(x)exp(-abs(x)))
Chris Lin
le 7 Août 2021
Is there something in particular that's difficult about changing the equation?
fplot(@(x)sin(x).*exp(-abs(x)))
Chris Lin
le 11 Août 2021
Dave B
le 11 Août 2021
Hi Chris, can you expand on your question a bit?
Walter Roberson
le 11 Août 2021
nexttile means to move to the next sub plot. It is a more modern way of using subplot() that has some advantages.
Chris Lin
le 7 Août 2021
0 votes
5 commentaires
fplot(@(x)sin(x).*exp(-abs(x)), [-10 10])
format long g
k = 2
y = @(x) sin(x).*exp(-abs(x)).*exp(-i.*k.*x)
syms x
area_sym = simplify(int(y(x), x, -10, 10))
double(area_sym)
area_numeric = integral(y, -10, 10 )
Chris Lin
le 8 Août 2021
format long g
y = @(x,k) sin(x).*exp(-abs(x)).*exp(-i.*k.*x)
syms x k
area_sym = simplify(int(y(x,k), x, -10, 10))
area_k_sym = simplify(subs(area_sym,k,(1:8).'))
double(area_k_sym)
Catégories
En savoir plus sur Annotations dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!





