How do I multiply two trigonometric functions

12 visualizaciones (últimos 30 días)
Alexander  Lleonart
Alexander Lleonart el 16 de Feb. de 2016
Comentada: John Hart el 4 de Mayo de 2020
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 comentario
John Hart
John Hart el 4 de Mayo de 2020
this was very helpful, thanks belleagured student .... in MSEE program

Iniciar sesión para comentar.

Respuestas (1)

the cyclist
the cyclist el 16 de Feb. de 2016
You need element-wise multiplication
y=sin(x).*cos(x);
  5 comentarios
the cyclist
the cyclist el 17 de Feb. de 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.
Muhammad Munam  Naseer
Muhammad Munam Naseer el 17 de Ag. de 2016
thanx. solved my problem

Iniciar sesión para comentar.

Categorías

Más información sobre Annotations en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by