Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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!
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* +6Step 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