Question: Write a MATLAB script to create an n times n tridiagonal matrix (where n is a variable you specify at the beginning of your script)

 Write a MATLAB script to create an n times n tridiagonal

Write a MATLAB script to create an n times n tridiagonal matrix (where n is a variable you specify at the beginning of your script) with entries of -2 along the main diagonal and entries of 1 along the diagonals just below and just above the main diagonal, i.e. A = [-2 1 1 -2 1 1 -2 1 1 -2 1 1 -2]

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!