what is wrong?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
i want to plot the function f(x)=sin(x)*cos(2*x)+1 , xe[-3,3].
my code is:
x=-3:0.1:3
y=sin(x)*cox(2*x)+1
plot(x,y)
Can you please help me? I'm new in MatLab programming and i have no idea what's wrong. Thank you.
0 Kommentare
Antworten (3)
Chenguang Yan
am 21 Okt. 2020
Bearbeitet: Chenguang Yan
am 21 Okt. 2020
- Misspelling : cox -> cos
- * (Matrix multiplication) -> .* (Multiplication)
Try this:
x = -3:0.1:3
y = sin(x).*cos(2*x)+1
plot(x,y)
Or use fplot()
syms x
y = sin(x).*cos(2*x)+1
fplot(y,[-3,3])
0 Kommentare
Siehe auch
Kategorien
Mehr zu Special Functions 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!