MATLAB Answers

0

How to do polynomial differentiation

Asked by Raiven Balderas on 28 Mar 2018
Latest activity Commented on by Raiven Balderas on 28 Mar 2018
How to do polynomial differentiation without using known matlab commands

  2 Comments

Why wouldn't you want to use known matlab commands. And for that matter, what are unknown matlab commands then?
see below accepted answer :)

Sign in to comment.

Tags

2 Answers

Answer by Roger Stafford on 28 Mar 2018
 Accepted Answer

Let P be the usual Matlab row vector of coefficients of a polynomial. Then, (as we all learned in calculus,) the corresponding vector of coefficients of the polynomial's derivative, dP, is:
n = length(P);
dP = (n-1:-1:1).*P(1:n-1);

  1 Comment

Thanks ! I love math and have taken up to calculus 3 , but for some reason me and coding matlab do not mix. thank you very much . great answer

Sign in to comment.


Answer by Walter Roberson
on 28 Mar 2018

Multiply each location in the coefficient vector by the degree it corresponds to, and get rid of the location corresponding to degree 0. You can probably build the degree list using the ":" operator.

  0 Comments

Sign in to comment.