フィルターのクリア

Why am I getting syntax

1 回表示 (過去 30 日間)
Kausalya Devi Subramaniam
Kausalya Devi Subramaniam 2022 年 6 月 13 日
回答済み: Benjamin Thompson 2022 年 6 月 13 日
dwdx=@(X)ks*(((FA0.*(1-X).*R.*T.*y)./(v.*(1+esp.*X)))-(((FA0.*(theta_B+X).*R.*T.*y)/(v.*(1+esp.*X))*((FA0.*(theta_C+X).*R.*T.*y)/(v.*(1+esp.*X)))/(Ke)))/(((1+(KA.*(FA0.*(1-X).*R.*T.*y)./(v.*(1+esp.*X)))+(KB.*(FA0.*(theta_B+X).*R.*T.*y)/(v.*(1+esp.*X)))+(KC.*(FA0.*(theta_C+X).*R.*T.*y)/(v.*(1+esp.*X)))).^2);
I dont know where i go wrong. I keep on getting syntax parentheses error.

回答 (1 件)

Benjamin Thompson
Benjamin Thompson 2022 年 6 月 13 日
Missing two closing parenthesis it would appear. Is MATLAB suggestion not correct? You might do better breaking this up into multiple lines using the ... operator notation for easier readability.
>> dwdx=@(X)ks*(((FA0.*(1-X).*R.*T.*y)./(v.*(1+esp.*X)))-(((FA0.*(theta_B+X).*R.*T.*y)/(v.*(1+esp.*X))*((FA0.*(theta_C+X).*R.*T.*y)/(v.*(1+esp.*X)))/(Ke)))/(((1+(KA.*(FA0.*(1-X).*R.*T.*y)./(v.*(1+esp.*X)))+(KB.*(FA0.*(theta_B+X).*R.*T.*y)/(v.*(1+esp.*X)))+(KC.*(FA0.*(theta_C+X).*R.*T.*y)/(v.*(1+esp.*X)))).^2);
dwdx=@(X)ks*(((FA0.*(1-X).*R.*T.*y)./(v.*(1+esp.*X)))-(((FA0.*(theta_B+X).*R.*T.*y)/(v.*(1+esp.*X))*((FA0.*(theta_C+X).*R.*T.*y)/(v.*(1+esp.*X)))/(Ke)))/(((1+(KA.*(FA0.*(1-X).*R.*T.*y)./(v.*(1+esp.*X)))+(KB.*(FA0.*(theta_B+X).*R.*T.*y)/(v.*(1+esp.*X)))+(KC.*(FA0.*(theta_C+X).*R.*T.*y)/(v.*(1+esp.*X)))).^2);
Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.
Did you mean:
>> dwdx=@(X)ks*(((FA0.*(1-X).*R.*T.*y)./(v.*(1+eps.*X)))-(((FA0.*(theta_B+X).*R.*T.*y)/(v.*(1+eps.*X))*((FA0.*(theta_C+X).*R.*T.*y)/(v.*(1+eps.*X)))/(Ke)))/(((1+(KA.*(FA0.*(1-X).*R.*T.*y)./(v.*(1+eps.*X)))+(db.*(FA0.*(theta_B+X).*R.*T.*y)/(v.*(1+eps.*X)))+(KC.*(FA0.*(theta_C+X).*R.*T.*y)/(v.*(1+eps.*X)))).^2)));

カテゴリ

Help Center および File ExchangeLogical についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by