Error in fzero function

8 vues (au cours des 30 derniers jours)
Sam Oznc
Sam Oznc le 9 Avr 2018
Commenté : Sam Oznc le 9 Avr 2018
why i got this error and how can i fix this?
Thank you..
a=log(0.5)*log10(30)*sin(pi/6); b=0.5*(atan(0.5))*3^(1/5);
fzero('x^3+2*a-b',-1)
FZERO cannot continue because user-supplied expression ==> x^3+2*a-b failed with the error below.
Error in inline expression ==> x^3+2*a-b Undefined function or variable 'a'.

Réponse acceptée

James Tursa
James Tursa le 9 Avr 2018
Use a function handle. E.g.,
fzero(@(x)x^3+2*a-b,-1)
  1 commentaire
Sam Oznc
Sam Oznc le 9 Avr 2018
Oh you are awesome. Thank you

Connectez-vous pour commenter.

Plus de 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