Question: 2) Create a Matlab function called tridfun.nthat solves the tridiagonal system of equations Au = k. It is important to understand tha h ll be

2) Create a Matlab function called tridfun.nthat solves the tridiagonal system of equations Au = k. It is important to understand tha h ll be both a main program tridmain.m and the function tridfun.n that the main program calls. To provide an example, suppose that A is the tridiagonal matrix 3 5 0 0 A=10573 and k is the vector 13 27 43 41 Then your main program tridnain. should closely resemble clear; n-4 a-[3 4 7 81 b-[5 6 3] c [1 5 3] k [13 27 43 41] u tridfun (n,a,b,c,k) Here the comrnand n-4 gives the size of the problem (A is 4 x 4, k is 4 1), vector a contains the diagonal entries of A, vector b contains the superdiagonal entries of A, and vector c contains the subdiagonal entries of A. Note that your code should not erplicitly form the matriz A. If the code in your function tridfun.m works correctly, the vector u should be calculated as
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
