Hi, how can i proceed with this question, everytime i plot it, it doesn't show me my line. Can u guys help me

1 次查看(过去 30 天)
x = -10 : 0.01 : 10;
y = (exp(x)/ sin(x)) + 0.3;
plot(x,y)

采纳的回答

Jan Studnicka
Jan Studnicka 2019-11-8
You are missing . before /. See:
x = -10 : 0.01 : 10;
y = (exp(x)./ sin(x)) + 0.3; % use ./ instead of /
plot(x,y)

更多回答(1 个)

the cyclist
the cyclist 2019-11-8
编辑:the cyclist 2019-11-8
It's because you used a matrix division instead of an element-wise division to calculate y. Try this instead:
y = (exp(x)./ sin(x)) + 0.3;
Note the use of ./ in place of just / in the formula.
See this documentation for more details.

类别

Help CenterFile Exchange 中查找有关 2-D and 3-D Plots 的更多信息

产品


版本

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by