Question: Is there a command to generate a second-difference matrix of size n by n?

Is there a command to generate a second-difference matrix of size n by n?

This matrix has 2s on its main diagonal and -1 above and below each main diagonal element.

Please Wait...