How to solve this kind of equation

Hi all!
How do I solve the equation y=sin(x)+ e^(0.25x-1.5)? I need the roots...
Also how do I draw it and show the x and y axes?
Thanks!

2 个评论

That is not a polynomial equation!
Sorry, fixed the topic.

请先登录,再进行评论。

回答(2 个)

x = [-20:.01:20]';
y=sin(x)+exp(0.25*x-1.5);
figure;plot(x,y);grid

2 个评论

Thanks. I'm also looking for the roots, how can I calculate them?
Numerically. But, as you can see from the plot, when x <-10 it becomes a sine wave. Also, all the roots are x<5.3 so that can constrain your search.

请先登录,再进行评论。

Matt J
Matt J 2012-12-11
编辑:Matt J 2012-12-11
The function has infinitely many roots, but here's a way to find one of them
fun=@(x) sin(x)+ exp(0.25*x-1.5)
xroot = fzero(fun, 0)
and to plot in some interval, e.g. [-10,3]
fplot(fun, [-10,3])

类别

帮助中心File Exchange 中查找有关 Function Handles 的更多信息

提问:

2012-12-11

Community Treasure Hunt

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

Start Hunting!

Translated by