Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1609243
  • 博文数量: 245
  • 博客积分: 10378
  • 博客等级: 上将
  • 技术积分: 2571
  • 用 户 组: 普通用户
  • 注册时间: 2009-03-27 08:19
文章分类

全部博文(245)

文章存档

2013年(4)

2012年(8)

2011年(13)

2010年(68)

2009年(152)

分类: LINUX

2010-03-23 15:49:20

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
阅读(1379) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~