DOC PREVIEW
CR MATH 45 - Exam #1|Matlab Component

This preview shows page 1 out of 4 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 4 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 4 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Solutions to ExercisesCollege of the RedwoodsMathematics DepartmentMath 45 – Linear AlgebraExam #1—Matlab ComponentDavid ArnoldCopyrightc° 2000 [email protected] Revision Date: September 25, 2000 Version 1.002Directions: This examination is to be completed at one contiguous sitting in PS116. There is a maximumtime limit of two hours. You are honor bound to complete all of this examination without any aid: fellowstudents, texts, manuals, notes, activities from the web, etc. The only aid you may use is the Matlab helpfiles, available by typing help at the Matlab prompt. Furthermore, you are not to discuss the contents of thisexamination with anyone until the examination is scored and returned in class. Good luck!Exercise 1. The Interpolating Polynomial. The goal of this examination question is to find an inter-polating polynomial of degree four that passes through each of the points (−3, 12), (−2, 4), (0, 0), (1, −6),and (4, 12).(a) Substitute each point into the general form for a fourth degree polynomial,p(x)=ax4+ bx3+ cx2+ dx + e,generating five equations in five unknowns. Record these equations on your examination paper.(b) Set up the augmented matrix for the system in part (a). Record this augmented matrix on your exami-nation paper.(c) Use Matlab to place the augmented matrix from part (b) in reduced row echelon form.(d) Use the results of part (c) to record the interpolating polynomial on your examination paper.(e) Use Matlab to prepare a sketch of the data and the interpolating polynomial. Plot the data points asdiscrete points. Plot the interpolating polynomial as a smooth curve traveling through each of the datapoints.When you have completed the examination, arrange your papers in order, then staple this examination ontop as a cover page. Place your name on this examination and record your starting and stopping times.Finally, if you used script files to produce any work in Matlab, include a copy of your script file with yourwork.Solutions to Exercises 3Solutions to ExercisesExercise 1(a) Substitute each of the given points into the general formp(x)=ax4+ bx3+ cx2+ dx + e.This gives five equations in five unknowns.12 = a(−3)4+ b(−3)3+ c(−3)2+ d(−3) + e4=a(−2)4+ b(−2)3+ c(−2)2+ d(−2) + e0=a(0)4+ b(0)3+ c(0)2+ d(0) + e−6=a(1)4+ b(1)3+ c(1)2+ d(1) + e12 = a(4)4+ b(4)3+ c(4)2+ d(4) + e¤Exercise 1(b) Set up the augmented matrix.(−3)4(−3)3(−3)2(−3)1112(−2)4(−2)3(−2)2(−2)114(0)4(0)3(0)2(0)110(1)4(1)3(1)2(1)11 −6(4)4(4)3(4)2(4)1112¤Exercise 1(c) First, enter the vectors of data points.>> x=[-3 -2 0 1 4]’x=-3-2014>> y=[12 4 0 -6 12]’y=1240-612Use element-wise operations to create the augmented matrix.>> M=[x.^4,x.^3,x.^2,x.^1,x.^0,y]M=81 -27 9 -3 1 1216 -8 4 -2 1 400001011111-6256 64 16 4 1 12Place the augmented matrix in reduced row echelon form.>> M=[x.^4,x.^3,x.^2,x.^1,x.^0,y]>> R=rref(M)R=100000.2222Solutions to Exercises 4010000.055600100-1.944400010-4.333300001 0Switching to rational format (format rat), one can easily see that this matrix equals,10000 2/901000 1/1800100−35/1800010 −13/300001 0¤Exercise 1(d) Thus, a =2/9, b =1/18, c = −35/18, d = −13/3, e = 0, and the interpolating polynomialisp(x)=29x4+118x3−3518x2−133x.¤Exercise 1(e) The following script file will plot the data points and the interpolating polynomial.>> p=[2/9,1/18,-35/18,-13/3,0];>> xx=linspace(-3.5,4.5);>> yy=polyval(p,xx);>> plot(x,y,’o’,xx,yy)This set of commands will produce the image shown in the following figure.−4 −2 0 2 4


View Full Document

CR MATH 45 - Exam #1|Matlab Component

Documents in this Course
Load more
Download Exam #1|Matlab Component
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Exam #1|Matlab Component and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Exam #1|Matlab Component 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?