ABSTRACT

Try it. The integral vector [-1 0 1] specifies in which diagonals the columns of [e d e] should be placed (use full(T) to see the full matrix T and spy(T) to view T graphically). Experiment with other values of m and n and, say, [-3 0 2] instead of [-1 0 1]. See doc spdiags for further features of spdiags.