How do I multiply two trigonometric functions
12 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(1 个)
the cyclist
2016-2-16
You need element-wise multiplication
y=sin(x).*cos(x);
5 个评论
the cyclist
2016-2-17
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.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Annotations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!