Question: Part 1: Plots of Polynomial Functions Write your own function that will calculate and plot any arbitrary polynomial function y(x). Your function should have
Part 1: Plots of Polynomial Functions Write your own function that will calculate and plot any arbitrary polynomial function y(x). Your function should have the following characteristics: 1) It should take as inputs: (i) a row or column vector that contain the coefficients of the different terms of the polynomial, (ii) the range of x over which you would like the polynomial to be calculated, 2) It should return as an output the value of the polynomial, y(x), at each value of x. 3) Within the function it should create a single plot which contains a plot of each term as well as the overall polynomial function. For example, for the polynomial given by y(x) = 5x 2x +4, the input row vector would be [4; 0; -2;5], and the final plot would look similar to that figure shown to the right. Hint: You may find that the use of a for loop and an if else conditional statement might be helpful to implement this function. A 8 91 -0.8 -0.6 Plot of Polynomial of Order 31 -0.4 -0.2 0 X 0.2 0.4 --Term 1 -Term 2 -Term 3- Term 4 -y(x) F06tivade VVIN
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
