factor matlab,Factorization

该文介绍了如何使用`factor`函数在不同模式下对数学表达式进行因式分解。默认模式是在有理数域内进行,保持有理数的符号形式。实数模式将表达式分解为实数系数的线性和二次不可约多项式。复数模式则将二次多项式简化为带复数系数的一次表达式。全因式分解模式将表达式分解为最简形式,包括立方根等。文章通过示例展示了各种模式的因式结果,并用`vpa`函数近似浮点数表示。
摘要由CSDN通过智能技术生成

Choose Factorization Modes

Use the FactorMode argument

to choose a particular factorization mode.

Factor an expression without specifying the factorization mode.

By default, factor uses factorization over rational

numbers. In this mode, factor keeps rational

numbers in their exact symbolic form.

syms x

factor(x^3 + 2, x)

ans =

x^3 + 2

Factor the same expression, but this time use numeric factorization

over real numbers. This mode factors the expression into linear and

quadratic irreducible polynomials with real coefficients and converts

all numeric values to floating-point numbers.

factor(x^3 + 2, x, 'FactorMode', 'real')

ans =

[ x + 1.2599210498948731647672106072782,...

x^2 - 1.2599210498948731647672106072782*x + 1.5874010519681994747517056392723]

Factor this expression using factorization over complex numbers.

In this mode, factor reduces quadratic polynomials

to linear expressions with complex coefficients. This mode converts

all numeric values to floating-point numbers.

factor(x^3 + 2, x, 'FactorMode', 'complex')

ans =

[ x + 1.2599210498948731647672106072782,...

x - 0.62996052494743658238360530363911 + 1.0911236359717214035600726141898i,...

x - 0.62996052494743658238360530363911 - 1.0911236359717214035600726141898i]

Factor this expression using the full factorization mode. This

mode factors the expression into linear expressions, reducing quadratic

polynomials to linear expressions with complex coefficients. This

mode keeps rational numbers in their exact symbolic form.

factor(x^3 + 2, x, 'FactorMode', 'full')

ans =

[ x + 2^(1/3),...

x - 2^(1/3)*((3^(1/2)*1i)/2 + 1/2),...

x + 2^(1/3)*((3^(1/2)*1i)/2 - 1/2)]

Approximate the result with floating-point numbers by using vpa.

Because the expression does not contain any symbolic parameters besides

the variable x, the result is the same as in complex

factorization mode.

vpa(ans)

ans =

[ x + 1.2599210498948731647672106072782,...

x - 0.62996052494743658238360530363911 - 1.0911236359717214035600726141898i,...

x - 0.62996052494743658238360530363911 + 1.0911236359717214035600726141898i]

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值