How do I multiply two trigonometric functions
7 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hi I am trying to multiply sin(x) by the cos(x) and graph the result. What am I doing now is not working. Can someone please explain to me what I am doing wrong? Here is my code.
x=[-2:0.5:10];
y=(sin(x))*(cos(x));
plot(x,y)
1 Kommentar
Antworten (1)
the cyclist
am 16 Feb. 2016
You need element-wise multiplication
y=sin(x).*cos(x);
5 Kommentare
the cyclist
am 17 Feb. 2016
The best form of thanks is to upvote and/or accept an answer. This rewards the contributor, and can point future users to helpful answers.
Siehe auch
Kategorien
Mehr zu Annotations 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!