灵巫 发表于 2012-10-17 15:35

关于solve函数的问题,求指导!

syms x y;
S=solve('-1=(x*exp(-1i*y)+1/x)/(-exp(-1i*y)+1)','1=(exp(-1i*y)-1)/(-exp(-1i*y)/x-x)','x','y');

报错为:
' -1=(x*exp(-1i*y)+1/x)/(-exp(-1i*y)+1) ' is not a valid expression or equation.

怎么修改啊?

吴建宏 发表于 2012-10-17 22:15

我使用的 MATLAB2012b
>> syms x y;
S=solve(-1==(x*exp(-1i*y)+1/x)/(-exp(-1i*y)+1),1==(exp(-1i*y)-1)/(-exp(-1i*y)/x-x));
>> S.x

ans =

2^(1/2) + 1
1 - 2^(1/2)

>> S.y

ans =

pi
pi

虽然版本不同,但是你的主要错误在于,等于“==”和赋值“=”混淆了

灵巫 发表于 2012-10-18 10:46

吴建宏 发表于 2012-10-17 22:15 static/image/common/back.gif
我使用的 MATLAB2012b
>> syms x y;
S=solve(-1==(x*exp(-1i*y)+1/x)/(-exp(-1i*y)+1),1==(exp(-1i*y)-1) ...

谢谢。我用的R2009a,按照你的输入,还是报错,如下:
??? Error using ==> char
Conversion to char from logical is not possible.
页: [1]
查看完整版本: 关于solve函数的问题,求指导!