Question: How to write this matlab function? In this question, you will write a function that calculates the coefficients of the derivatives of real polynomials. Consider
In this question, you will write a function that calculates the coefficients of the derivatives of real polynomials. Consider a real polynomial P of degree n or lower. This polynomial can be written asP(x) = b_nx^n + b_n - 1x^n - 1 + ... + b_1x + b_0 where the b'_i, s, i = {0, 1, ...n} are real coefficients. The derivative of this polynomial is the polynomial P such that: P(x) = nb_nx^n - 1 + (n - 1)b_n - 1x^n - 2 + ... + 2b_zx + b_1 This polynomial can be written in the form: P'(x) = c_nx^n + c_n - 1x^n - 1 + ... + c_1x + c_0 where the c'_1 s, i = {0, 1, ..., n} are real coefficients that can be calculated from the b'_is (note that c_n = 0). By applying this reasoning multiple times, we can show that the polynomial P, and any of its derivatives (first, second, and higher derivatives) can be written in the form: a_nx^n + a_n - 1x^n - 1 + ...a_1x + a_0 In this question, you will write a function calculates the coefficients of the k^th derivative of a polynomial, given the coefficient pf this polynomial. More precisely, write a function with the following header: function [coefficients_d] = ay_d_polynomial (coefficients. k) where: coefficients is a 1 times (n + 1) array of class double that represents the coefficients a_n, a_n - 1, ..., a_0 (in this order) of a real polynomial P of degree n or lower, as given by Equation 9. You can assume that n greaterthanorequalto 0 and that all the elements of coefficients are from NaN, Inf, and -Inf. k is a scalar of class double that represents an integer that is greater than or equal to a. coefficients_d is a 1 times (n + 1) array of class double that represents the coefficients a_n + a_n - 1... a_0 (in this order) of the polynomial P^(k), as given by Equation 9. P^(k) is the k^th derivative of P. Note that Peon P^(0) = P(i.e. the 0^th derivative of P is P itself)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
