ROOTS(C) computes the roots of the polynomial whose coefficients
are the elements of the vector C. If C has N+1 components,
the polynomial is C(1)*X^N + ... + C(N)*X + C(N+1).
Class support for input c:
float: double, single
e.g,
a=[1,-1,0.9];
z=roots(a);
roots就是解a=[1,-1,0.9]式子的根。
按照a=[1,-1,0.9],要解的方程是:
设未知及参数设为x , 则:
x^2-x+0.9=0的根。
例如:
x^2-2x+1=0;
>> a=[1,-2,1]
a =
1 -2 1
>> z=roots(a)
z =
1
1
阅读(1426) | 评论(0) | 转发(0) |