I went through the tutorials which was organized in a very neat way. Then I proceeded to implement the following simple code.
Make a tridiagonal matrix with 1 on diagonal and 0 or on off-diagonal with an arbitrary n. See the following example for n=5.
[1000001000001000001000001]
The following is my implementation.