561
|
1 function p = polyderiv(p) |
|
2 #polyderiv(c) |
|
3 #Returns the coefficients of the derivative of the polynomial whose |
|
4 #coefficients are given by vector c. |
|
5 # |
|
6 #SEE ALSO: poly, polyinteg, polyreduce, roots, conv, deconv, residue, |
|
7 # filter, polyval, polyvalm |
|
8 |
|
9 # Author: |
|
10 # Tony Richardson |
|
11 # amr@mpl.ucsd.edu |
|
12 # June 1994 |
|
13 |
|
14 if(nargin != 1) |
|
15 error("usage: polyderiv(vector)"); |
|
16 endif |
|
17 |
|
18 if(is_matrix(p)) |
|
19 error("argument must be a vector"); |
|
20 endif |
|
21 |
|
22 lp = length(p); |
|
23 if(lp == 1) |
|
24 p = 0; |
|
25 return; |
|
26 elseif (lp == 0) |
|
27 p = []; |
|
28 return; |
|
29 end |
|
30 |
|
31 p = p(1:(lp-1)) .* [(lp-1):-1:1]; |
|
32 |
|
33 endfunction |