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 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
Get step-by-step solutions from verified subject matter experts
