Matlab - Banded Matrix

I'm trying to make a banded matrix in matlab like the one in my picture.

I'm trying to use the spdiags function but i'm not going even close to getting the same matrix.

I have tried the help in Matlab but have had no luck yet.

How can you tell the bandwidth is 7?

Last edited: