Is this code right?

5 vues (au cours des 30 derniers jours)
Bob
Bob le 31 Jan 2015
Commenté : Daniela Valdés le 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 commentaires
Bob
Bob le 31 Jan 2015
Anyone?
Daniela Valdés
Daniela Valdés le 31 Jan 2015
No. Use:
fzero(@(x) sin(x)-cos(2*x),1)

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Problem-Based Optimization Setup dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by