Invalid indexing when simplifying a symbolic expression

1 visualización (últimos 30 días)
Brian Balzano
Brian Balzano el 13 de Sept. de 2019
Comentada: madhan ravi el 13 de Sept. de 2019
I am trying to somplfy an expression using the script below.
clc,clear
syms k4f k3f k3r k2f k2r C E0 S
eqn = k4f*(E0 - E0*(k3r+k4f) / (((k3f*k2f*C*S)/k2r)+(k3r*k4f)*(1+k2f*C/k2r)) - E0*k2f*C(k3r+k4f) / k2r*(((k3f*k2f*C*S)/k2r)+(k3r*k4f)*(1+k2f*C/k2r)));
simplfy(eqn)
When trying to simplfy "eqn", I get the following error messages...
Error using sym/subsindex (line 814)
Invalid indexing or function definition. Indexing
must follow MATLAB indexing. Function arguments
must be symbolic variables, and function body
must be sym expression.
Error in sym/subsref (line 859)
R_tilde =
builtin('subsref',L_tilde,Idx);
Error in Simplify_Eqn (line 3)
eqn = k4f*(E0 - E0*(k3r+k4f) /
(((k3f*k2f*C*S)/k2r)+(k3r*k4f)*(1+k2f*C/k2r)) -
E0*k2f*C(k3r+k4f) /
k2r*(((k3f*k2f*C*S)/k2r)+(k3r*k4f)*(1+k2f*C/k2r)));
>>
Any help is appreciated!

Respuestas (1)

Fabio Freschi
Fabio Freschi el 13 de Sept. de 2019
C is used as a function
C(k3r+k4f)

Categorías

Más información sobre Symbolic Math Toolbox 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