How do I multiply two trigonometric functions

조회 수: 12 (최근 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 CenterFile Exchange에서 Annotations에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by