How can I plot the function y = e^(-2x^2) * cos(4pi*x - 1.5)?

2 Ansichten (letzte 30 Tage)
emma
emma am 11 Feb. 2021
Kommentiert: emma am 11 Feb. 2021
How do I plot the function of y = e^(-2x^2) * cos(4pi*x - 1.5)? This is what I have so far but I can't seem to figure out what to do for the x coordinate. Is my y correct? Please help!
x=?
y=exp(-2.*x.^2) .* cos(4.*pi.*x - 1.5)
plot(x,y)

Akzeptierte Antwort

James Tursa
James Tursa am 11 Feb. 2021
Pick a range for x. E.g.,
x = 0:0.01:2;
y = exp(-2.*x.^2) .* cos(4.*pi.*x - 1.5);
plot(x,y)
  1 Kommentar
emma
emma am 11 Feb. 2021
Thank you! I was entering an incorrect range. This solved my issue.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

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

Community Treasure Hunt

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

Start Hunting!

Translated by