How do I multiply two trigonometric functions

11 ビュー (過去 30 日間)
Alexander  Lleonart
Alexander Lleonart 2016 年 2 月 16 日
コメント済み: John Hart 2020 年 5 月 4 日
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 件のコメント
John Hart
John Hart 2020 年 5 月 4 日
this was very helpful, thanks belleagured student .... in MSEE program

サインインしてコメントする。

回答 (1 件)

the cyclist
the cyclist 2016 年 2 月 16 日
You need element-wise multiplication
y=sin(x).*cos(x);
  5 件のコメント
the cyclist
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.
Muhammad Munam  Naseer
Muhammad Munam Naseer 2016 年 8 月 17 日
thanx. solved my problem

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeAnnotations についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by