Question: Write a Matlab program that will allow the user to enter the coefficients of a polynomial and make some calculations. Selections and data entry will

Write a Matlab program that will allow the user to enter the coefficients of a polynomial and make some calculations. Selections and data entry will be done by presenting the user with a menu (using menu function) and provide her/him with the following choices:

Enter the degree and coefficients of the polynomial

Evaluate the polynomial at a user defined point

Display the roots of the polynomial

Exit

Other Requirements:

Selecting choice 2 and 3 before entering the degree and coefficients will result in an error message.

The program will terminate only when Exit has been selected

Calculations will be done by functions.

o Function polynomial() will ask for the degree and the coefficients of the polynomial and would return the coefficients.

o Function polyEval() will accept a parameter, the evaluation point, and returns the value of the polynomial at that point.

o Function polyRoots() will accept the coefficients and returns the roots. Results are displayed with 2 decimal place accuracy.

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!