plot and then plot the same graph with filled area

14 次查看(过去 30 天)
Greetings all,
I am working on developing a code to polt a curve then plot another code for the same curve with area underneath filled. my cose is as follow:
x = ([0,2*pi])
w = @(x) x*exp(-x)*cos(x)
fplot(w ,x)
figure;
area(w)
the first plot is OK but the second is not

回答(1 个)

KSSV
KSSV 2021-9-8
x = linspace(0,2*pi) ;
w = @(x) x.*exp(-x).*cos(x) ;
y = w(x) ;
figure
plot(x ,y)
figure;
area(x,y)

类别

Help CenterFile Exchange 中查找有关 2-D and 3-D Plots 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by