function handles(solving equations)

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일

0 개 추천

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

Dominic
Dominic 2011년 3월 30일
whats the correct syntax to write the equations? I keep getting errors in that part.
Walter Roberson
Walter Roberson 2011년 3월 30일
My guess is that you might be omitting the (implied) multiplication between the terms, but we won't know unless you show us what you have tried.
hamzeh almasri
hamzeh almasri 2016년 12월 25일
please Can you send the answer in detail
g = @(x) exp(-0.2. *x) .* sin(x+2) - 0.1
and fsolve on g

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Function Creation에 대해 자세히 알아보기

질문:

2011년 3월 28일

댓글:

2020년 3월 24일

Community Treasure Hunt

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

Start Hunting!

Translated by