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'.

 採用された回答

James Tursa
James Tursa 2018 年 4 月 9 日

0 投票

Use a function handle. E.g.,
fzero(@(x)x^3+2*a-b,-1)

1 件のコメント

Sam Oznc
Sam Oznc 2018 年 4 月 9 日
Oh you are awesome. Thank you

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeProblem-Based Optimization Setup についてさらに検索

タグ

質問済み:

2018 年 4 月 9 日

コメント済み:

2018 年 4 月 9 日

Community Treasure Hunt

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

Start Hunting!

Translated by