Exercise 4

The following exercises are meant to be answered by a single MATLAB command. The command may be involved (i.e., it may use a number of parentheses or calls to functions) but can, in essence, be solved by the execution of a single command. If the command is too complicated, feel free to break it up over two or more lines.

Polynomials

1.

  f(x) = x2+2x+3

  g(x) = 9x4+4x3+3x2+2x+1

   
 

a. Find the roots of the functions f(x) and g(x).

 

b. Divide the polynomial g(x) by f(x).

 

c. Multiply the polynomial f(x) by g(x).

   

2.

a. Find the partial fraction expansion of the function:

 

 

 

 

b. Residue converts back the following function to polynomial form:

 

 
3.

Find the roots of the following equation:

 

      x4-23x3+135x2+99x-1620 = 0

 

Then plot the equation and roots on a same figure. Also, place a title, x label, y label and legends on the plot.

 
4.

x-y data is contained in a file named polyfit_data.mat in the share folder.

 

a.      Import the data into your MATLAB workspace. Plot y against x as blue circle marker.

b     Find the lowest order of polynomial that fits this data. What is the equation for the polynomial? Plot the polynomial on the same figure. Label x and y-axes. Add legends to the figure.

c.      What is the value of the polynomial at x=3.6, x=7.3 and x=13.1 ? Mark these points on the figure as cyan plus sign.

 

3-D Visualization

5.

Create a 3-D graphic similar to the 3-D visualization as shown below. Please make your graph as silimar as the following visualization in terms of shape, color, and lighting effect. (Using the command sphere and the function may be helpful here.)