www.gusucode.com > matlab双曲多项式工具箱(HPT) > matlab双曲多项式工具箱(HPT)/matlab双曲多项式工具箱(HPT)/hyperbolic_polynomial_toolbox/testing_functions/derivative_polynomial.m

    function dp = derivative_polynomial(c)
%function dp = derivative_polynomial(C)
%
% Calculate the derivative of a polynomial.
%
% Input:
%   C - Polynomial coefficients, as in MATLAB function roots.
% Output:
%   dp - Coefficients of the derivative polynomial. 

degree = length(c)-1;
dp = c(1:end-1);
for i = 1:degree
	dp(i) = c(i)*(degree-i+1);
end