plot and then plot the same graph with filled area

2 Ansichten (letzte 30 Tage)
basim almutairi
basim almutairi am 8 Sep. 2021
Beantwortet: KSSV am 8 Sep. 2021
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

Antworten (1)

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

Kategorien

Mehr zu 2-D and 3-D Plots finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by