Is this code right?

5 views (last 30 days)
Bob
Bob on 31 Jan 2015
Commented: Daniela Valdés on 31 Jan 2015
question: Use fzero to approximate a root of sin(x) = cos(2x) near x = 1.
code: fzero('sin(x)==cos(2*x)',1)
answer: 1
  2 Comments
Bob
Bob on 31 Jan 2015
Anyone?
Daniela Valdés
Daniela Valdés on 31 Jan 2015
No. Use:
fzero(@(x) sin(x)-cos(2*x),1)

Sign in to comment.

Answers (0)

Categories

Find more on Problem-Based Optimization Setup in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!