why can't i draw diagram of function abs(sin3x/sin(x/2)) in matlab?

3 次查看(过去 30 天)
my code:
x=-pi:0.1:pi;
y=abs(sin(3*x)/sin(x/2));
plot(x,y);

采纳的回答

Star Strider
Star Strider 2017-4-13
Because you are not using element-wise division (with the ‘dot’ operator, as ‘./’).
This works:
x=-pi:0.1:pi;
y=abs(sin(3*x)./sin(x/2));
plot(x,y);
See the documentation on Array vs. Matrix Operations for all the details.
  7 个评论

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Logical 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by