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