Is this code right?

5 Ansichten (letzte 30 Tage)
Bob
Bob am 31 Jan. 2015
Kommentiert: Daniela Valdés am 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 Kommentare
Bob
Bob am 31 Jan. 2015
Anyone?
Daniela Valdés
Daniela Valdés am 31 Jan. 2015
No. Use:
fzero(@(x) sin(x)-cos(2*x),1)

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Problem-Based Optimization Setup finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by