Question: Need help solving this on matlab just part a 2) In class, we derived the following matrix equation that must be solved to generate cubic

 Need help solving this on matlab just part a 2) In

Need help solving this on matlab

just part a

2) In class, we derived the following matrix equation that must be solved to generate cubic spline interpolation 01 D2 D3 21 ZT-1 Un-2 hn-2 un-1 hn-1 (Here the blank entries in the matrix indicate these entries are equal to 0.) a) To form the natural cubic spline, we set zo0 and zn0 in (1), obtaining U1 12 U3 21 h ha Un-1 h-2 Un-1 2n-1 Write Matlab code to solve (2) (using your tridfun.m function), thus deter- mining the spline pieces S(z), and thus the entire spline S() Your code should then prompt the user for a number p and return the value S(p). Ifp is out of range, your program should say so. Finally, produce a Matlab plot of the graph of S(x). Have the spline itself as a solid green curve with the data points as magenta circles b) Another variant of the cubic spline is the "clamped" cubic spline in which we assign values to the derivative S'(z) at the endpoints to and tn. Modify (1) to include these two conditions while maintaining the tridiagonal structure, if possible. Your "answer" should be a matrix equation similar to (2). This is a "paper and pencil" exercise; I am not asking you to write code

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!