Question: Write a MATLAB function B=polint(P) which accepts as an input a polynomial P written through the standard basis (see Exercises 3 and 4 of this
Write a MATLAB function B=polint(P) which accepts as an input a polynomial P written through the standard basis (see Exercises 3 and 4 of this project). The function has to calculate the indefinite integral of the polynomial assigning a value 5 to an arbitrary constant. The output has to be a polynomial written through the standard basis as well. Do not use the MATLAB built in function int(P) in your code.
Suggested commands within your code:
syms x, sym2poly, poly2sym, length.
A single for loop can be used.
Type the function in your diary file.
Run polint on the following polynomials.
a) P=6*x^5+5*x^4+4*x^3+3*x^2+2*x+9
b) P=x^6-x^4+3x^2+1
**Right after getting an output for polint function for each of the polynomials, run a MATLAB built-in function int(P) (with the constant term added to it) to verify your outputs.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
