Why am I getting syntax

2 次查看(过去 30 天)
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 CenterFile Exchange 中查找有关 Logical 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by