Why am I getting syntax

2 vues (au cours des 30 derniers jours)
Kausalya Devi Subramaniam
Kausalya Devi Subramaniam le 13 Juin 2022
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.

Réponses (1)

Benjamin Thompson
Benjamin Thompson le 13 Juin 2022
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)));

Catégories

En savoir plus sur Logical 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