Why am I getting syntax

2 visualizaciones (últimos 30 días)
Kausalya Devi Subramaniam
Kausalya Devi Subramaniam el 13 de Jun. de 2022
Respondida: Benjamin Thompson el 13 de Jun. de 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.

Respuestas (1)

Benjamin Thompson
Benjamin Thompson el 13 de Jun. de 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)));

Categorías

Más información sobre Logical en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by