MATLAB syms错误

时间:2017-08-09 06:49:35

标签: matlab function symbols equation

我有两个根。 Er1Er2Er1 = Er1r+(Er1i)*iEr2 = Er2r+(Er2i)*i。所以它们很复杂。

syms Er1r Er1i Er2r Er2i real

Er1 = Er1r+(Er1i)*i
Er2 = Er2r+(Er2i)*i
Er  = [Er1,Er2]

h = 0.0001

Er111 = (Er1r+h)+(Er1i)*i
Er112 = (Er1r-h)+(Er1i)*i
Er121 = (Er1r)+(Er1i+h)*i
Er122 = (Er1r)+(Er1i-h)*i

Er211 = (Er2r+h)+(Er2i)*i
Er212 = (Er2r-h)+(Er2i)*i
Er221 = (Er2r)+(Er2i+h)*i
Er222 = (Er2r)+(Er2i-h)*i

eqn1(Er) = 3*Er111^2+5*Er111+Er111
eqn2(Er) = 7*Er112^2-4*Er112+2*Er112
.
.
.
eqn8(Er) = 3*Er222^2+9*Er222-4*Er222

我想写8个方程式。但他们是功能。所以呃是象征。我有错误。我该如何解决?

错误讯息;

Error using sym/subsindex (line 766)
Invalid indexing or function definition. When defining a function, ensure that the arguments are symbolic variables and the body of
the function is a SYM expression. When indexing, the input must be numeric, logical, or ':'.

Error in sym/privsubsasgn (line 1031)
                L_tilde2 = builtin('subsasgn',L_tilde,struct('type','()','subs',{varargin}),R_tilde);

Error in sym/subsasgn (line 868)
            C = privsubsasgn(L,R,inds{:});

Error in m0708_2 (line 63)
eqn1(Er) = 3*Er111^2+5*Er111+Er111

0 个答案:

没有答案