Invalid indexing when simplifying a symbolic expression

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!

类别

帮助中心File Exchange 中查找有关 Symbolic Math Toolbox 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by