octave:2> help roots
'roots' is a function from the file /usr/share/octave/3.8.1/m/polynomial/roots.m
-- Function File: roots (V)
For a vector V with N components, return the roots of the
polynomial
v(1) * z^(N-1) + ... + v(N-1) * z + v(N)
As an example, the following code finds the roots of the quadratic
polynomial
p(x) = x^2 - 5.
c = [1, 0, -5];
roots (c)
=> 2.2361
=> -2.2361
Note that the true result is +/- sqrt(5) which is roughly +/-
2.2361.
See also: poly, compan, fzero.
很简单
octave
,把方程的系数代入roots
函数即可查看联机帮助
计算!可能适合您的需求: