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!
1 件のコメント
madhan ravi
2019 年 9 月 13 日
C you’re missing an operator here (k3r+k4f)
回答 (1 件)
Fabio Freschi
2019 年 9 月 13 日
C is used as a function
C(k3r+k4f)
カテゴリ
ヘルプ センター および File Exchange で Calculus についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!