function handles(solving equations)

12 次查看(过去 30 天)
Dominic
Dominic 2011-3-28
评论: Caprisun_ 2020-3-24
How to solve the equation e^(-0.2x)sin(x+2)=0.1 in the interval 0<x<10. Using the function fzero find the 3 solutions for this equation?
solve equation y=1+e^(-0.2x)sin(x=2) in interval 0<x<10. For the two minimum points find the x and y values at these points using function fminbnd.
Must create 2 functions for this problem and use function handles to produce both required answeres?
lost and need help
  1 个评论
Caprisun_
Caprisun_ 2020-3-24
f = @(x) exp(-0.2.*x).*sin(x+2)-.1; % Define the function.
x = 0:.01:10; % Define an x range for the plot;
plot(x,f(x))
fzero(f,1)
fzero(f,5)
fzero(f,7)

请先登录,再进行评论。

回答(1 个)

Walter Roberson
Walter Roberson 2011-3-28
Hints:
  • The equation f(x) = c is the same as f(x) - c = 0
  • If you have a function named g, then @g is the function handle for g.
  • e^x is written as exp(x)
  4 个评论
hamzeh almasri
hamzeh almasri 2016-12-25
please Can you send the answer in detail
Walter Roberson
Walter Roberson 2016-12-26
g = @(x) exp(-0.2. *x) .* sin(x+2) - 0.1
and fsolve on g

请先登录,再进行评论。

类别

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

Community Treasure Hunt

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

Start Hunting!

Translated by