Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

write a matlab function... function Q = dydx(P) % This function returns the valu

ID: 3592440 • Letter: W

Question

write a matlab function...

function Q = dydx(P)

% This function returns the value of a derivative function

% of a given polynomial P evaluated at X.

%

% Input argument

% P = a vector of length N+1 whose elements are the

% coefficients of the polynomial in descending powers:

% Y = P(1)*X^N + P(2)*X^(N-1) + ... + P(N+1)

%

% Output argument

% Q = a vector of length N whose elements are the

% coefficient of the derivative function of the given polynomial P:

% Y' = Q(1)*X^(N-1) + Q(2)*X^(N-2) + ... + Q(N)

Explanation / Answer

the given code is correct

function Q = dydx(P)
% This function returns the value of a derivative function
% of a given polynomial P evaluated at X.
%
% Input argument
% P = a vector of length N+1 whose elements are the
% coefficients of the polynomial in descending powers:
% Y = P(1)*X^N + P(2)*X^(N-1) + ... + P(N+1)
%
% Output argument
% Q = a vector of length N whose elements are the
% coefficient of the derivative function of the given polynomial P:
% Y' = Q(1)*X^(N-1) + Q(2)*X^(N-2) + ... + Q(N)