Question: Using basic Matlab polynomial functions. NO IF STATEMENTS solve using MATLAB! 15. Write a user-defined function that adds or subtracts two polynomials of any order.

 Using basic Matlab polynomial functions. NO IF STATEMENTS solve using MATLAB!

Using basic Matlab polynomial functions. NO IF STATEMENTS solve using MATLAB!

15. Write a user-defined function that adds or subtracts two polynomials of any order. Name the function p=polyadd (p1, p2, operation). The first two input arguments p1 and p2 are the vectors of the coefficients of the two polynomials. (If the two polynomials are not of the same order, the function adds the necessary zero elements to the shorter vector.) The third input argument operation is a string that can be either 'add' or 'sub', for adding or subtracting the polynomials, respectively, and the output argu- ment is the resulting polynomial. Use the function to add and subtract the following polynomials: S;(x) = 8x +10x 5x +13x - 4x 2 and f(x) = 4x* + 7x* +6

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!