0

次の操作を単純化したいのですが、「入力引数が多すぎます」というエラーが表示されます。誰が私が間違っているのか教えてもらえますか???

>> 
syms a b c d e  f g h i j k l x y xy

A=[1 a b a^2 a*b b^2; 1 c d c*2 c*d d^2; 1 e f e^2 e*f f^2; 1 g h g^2 g*h h^2; 1 i j         i^2 i*j j^2; 1 k l k^2 k*l l^2]

B=[1; 0; 0; 0; 0; 0]

A =

[ 1, a, b, a^2, a*b, b^2]
[ 1, c, d, 2*c, c*d, d^2]
[ 1, e, f, e^2, e*f, f^2]
[ 1, g, h, g^2, g*h, h^2]
[ 1, i, j, i^2, i*j, j^2]
[ 1, k, l, k^2, k*l, l^2]


B =

 1
 0
 0
 0
 0
 0

>> simplify(inv(A)*B, 'steps', 100)enter code here
4

2 に答える 2

0

貼り付けたコードを私の matlab (R2013a) のコピーに入れましたが、エラーなしで終了しました。ただし、結果はあまり単純化されていません。

コンピューターが計算を詰まらせている場合 (非常に長い)、物事を少し分けてみて、それが役立つかどうかを確認できます。

vec=inv(A)*B
for n=1:6
    results(n)=simplify(vec(n), 'steps', 100);
end
results
于 2013-03-28T10:01:22.540 に答える
0

あなたの呼び出しは、この MATLAB 関数に属します:

ただし、Symbolic Math Toolbox にはあります。つまり、複雑な行列計算ではなく、数式を単純化することしかできません。

Simplify Favoring Real Numbers

To force simplify favor real values over complex values, set the value of Criterion to preferReal:

syms x
f = (exp(x + exp(-x*i)/2 - exp(x*i)/2)*i)/2 - (exp(- x - exp(-x*i)/2 + exp(x*i)/2)*i)/2;
simplify(f, 'Criterion','preferReal', 'Steps', 100)
ans =
cos(sin(x))*sinh(x)*i + sin(sin(x))*cosh(x)
If x is a real value, then this form of expression explicitly shows the real and imaginary parts.

Although the result returned by simplify with the default setting for Criterion is shorter, here the complex value is a parameter of the sine function:

simplify(f, 'Steps', 100)
ans =
sin(x*i + sin(x))

代わりに、次の関数を試してみるとよいと思います: Simplify(f, Steps = numberOfSteps)

しかし、まず第一に、再帰または反復関数のように使用できる 'f' が必要です。

例えばSimplify(sin(x)^2 + cos(x)^2, All)

お役に立てれば!

于 2013-03-28T11:38:13.233 に答える