MATLAB爱好者论坛-LabFans.com

MATLAB爱好者论坛-LabFans.com (https://www.labfans.com/bbs/index.php)
-   MATLAB论坛 (https://www.labfans.com/bbs/forumdisplay.php?f=6)
-   -   [求助]怎样对符号表达式进行因式分解 (https://www.labfans.com/bbs/showthread.php?t=4179)

yanyan300300 2008-08-21 11:02

[求助]怎样对符号表达式进行因式分解
 
请问有一个高次的符号表达式,怎样利用matlab可以得到它的因式分解?或者有方法可以对符号表达式求零点吗?谢谢

pslpsl 2008-08-21 14:01

回复: [求助]怎样对符号表达式进行因式分解
 
[LEFT][COLOR=black][FONT=Times New Roman][B]solve(s)[/B][/FONT][/COLOR][COLOR=black][FONT=宋体][B]:求解符号表达式[/B][/FONT][/COLOR][COLOR=black][FONT=Times New Roman][B]s[/B][/FONT][/COLOR][COLOR=black][FONT=宋体][B]的代数方程,求解变量为默认变量。[/B][/FONT][/COLOR]
[COLOR=black][FONT=Times New Roman][B]solve([/B][/FONT][/COLOR][COLOR=black][FONT=Times New Roman][B]s,v[/B][/FONT][/COLOR][COLOR=black][FONT=Times New Roman][B])[/B][/FONT][/COLOR][COLOR=black][FONT=宋体][B]:求解符号表达式[/B][/FONT][/COLOR][COLOR=black][FONT=Times New Roman][B]s[/B][/FONT][/COLOR][COLOR=black][FONT=宋体][B]的代数方程,求解变量为[/B][/FONT][/COLOR][COLOR=black][FONT=Times New Roman][B]v[/B][/FONT][/COLOR][COLOR=black][FONT=宋体][B]。[/B][/FONT][/COLOR][/LEFT]
[COLOR=black][FONT=Times New Roman][B]solve(s1,s2,…,sn,v1,v2,…,[/B][/FONT][/COLOR][COLOR=black][FONT=Times New Roman][B]vn[/B][/FONT][/COLOR][COLOR=black][FONT=Times New Roman][B])[/B][/FONT][/COLOR][COLOR=black][FONT=宋体][B]:求解符号表达式[/B][/FONT][/COLOR][COLOR=black][FONT=Times New Roman][B]s1,s2,…,[/B][/FONT][/COLOR][COLOR=black][FONT=Times New Roman][B]sn[/B][/FONT][/COLOR][COLOR=black][FONT=宋体][B]组成的代数方程组,求解变量分别[/B][/FONT][/COLOR][COLOR=black][FONT=Times New Roman][B]v1,v2,…,[/B][/FONT][/COLOR][COLOR=black][FONT=Times New Roman][B]vn[/B][/FONT][/COLOR][COLOR=black][FONT=宋体][B]。[/B][/FONT][/COLOR]

pslpsl 2008-08-21 14:07

回复: [求助]怎样对符号表达式进行因式分解
 
比如解 a*x^2+b*x+c=0

[CODE]
syms a b c x;
s=solve(a*x^2+b*x+c,x);
s
[/CODE]

运行结果如下

[CODE]
s =

1/2/a*(-b+(b^2-4*a*c)^(1/2))
1/2/a*(-b-(b^2-4*a*c)^(1/2))
[/CODE]

Log54 2008-09-04 20:18

回复: [求助]怎样对符号表达式进行因式分解
 
factor函数貌似也可以用。但很傻。


所有时间均为北京时间。现在的时间是 11:09

Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.