Question: Create a function tridiagonal.m that will construct a tridiagonal matrix of size n x n , where n is an input passed to the function,

Create a function tridiagonal.m that will construct a tridiagonal matrix of size nxn, where
n is an input passed to the function, and the resulting matrix is the output. Along the
main diagonal, enter values of 2. Along the diagonals next to the main diagonal, enter
values of -1.
Write a script maketridiagmatrix.m that asks the user to input size n, then calls the
function tridiagonal.m, then displays the resulting matrix.
Example output would be (for n=7, say):
Create a function tridiagonal.m that will

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 Programming Questions!