559
|
1 function p = polyinteg(p) |
|
2 #polyinteg(c) |
|
3 #Returns the coefficients of the integral the polynomial whose coefficients |
|
4 #are represented by the vector c. |
|
5 # |
|
6 #The constant of integration is zero. |
|
7 # |
|
8 #SEE ALSO: poly, polyderiv, polyreduce, roots, conv, deconv, residue, |
|
9 # filter, polyval, polyvalm |
|
10 |
|
11 # Author: |
|
12 # Tony Richardson |
|
13 # amr@mpl.ucsd.edu |
|
14 # June 1994 |
|
15 |
|
16 if(nargin != 1) |
|
17 error("usage: polyinteg(vector)"); |
|
18 endif |
|
19 |
|
20 if(is_matrix(p)) |
|
21 error("argument must be a vector"); |
|
22 endif |
|
23 |
|
24 lp = length(p); |
|
25 |
|
26 if(lp == 0) |
|
27 p = []; |
|
28 return; |
|
29 end |
|
30 |
|
31 if(rows(p) > 1) |
|
32 # Convert to column vector |
|
33 p = p.'; |
|
34 endif |
|
35 |
|
36 p = [ p 0 ] ./ [lp:-1:1 1]; |
|
37 |
|
38 endfunction |