Answered step by step
Verified Expert Solution
Question
1 Approved Answer
2.5.Loops and Conditional Statements in MATLAB Part 1: Plots of Polynomial Functions Write your own function that will calculate and plot any arbitrary polynomial function
2.5.Loops and Conditional Statements in MATLAB 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 thea Plot of Polynomial of Order 3 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 2 y(x)= 5x3-2x2+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 4 and an if else conditional statement might be helpful to implement this function -2 --Term 1 -Term 2 -.Term 3 Term 4 -6 0.8 -0.6 -0.40.2 0.2 0.4 0.6 0.8
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started