Question: A symmetric tridiagonal matrix A can have nonzero values at only diagonal elements and elements just below or above diagonal elements. Also A ^ T

A symmetric tridiagonal matrix A can have nonzero values at only diagonal elements and elements just below or above diagonal elements. Also A^T=A due to the symmetry. For example,
A=((2100@1210@0121@0012))
is an n by n symmetric tridiagonal matrix with n=4, the diagonal elements d=2, and the non-diagonal elements a=1.
Write a MATLAB function A=symTri(n,d,a) to return such an n by n matrix A with the same diagonal values d and nondiagonal values a.
Use no special built-in functions.
Make an empty matrix A first. All the elements are zeros right after its creation.
For efficiency, your program should update the necessary elements only, i.e., do not rewrite a zero into another zero.
Include your .m script file in the zip file.
What is the asymptotic running time of your algorithm? Your answer should be O(f(n)) for a simple function f(n) of n. Briefly justify your answer regarding a substitution A_(i,j)x as one floating point operation A_(i,j)0+x.

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!