title: Create a tridiagonal matrix
body: <p>I need to program R with a matrix which has (1+x^2) down the leading diagonal (the constant value of x is given earlier in the program) and x down the diagonals on either side of the leading diagonal, and 0 everywhere else. I hope that makes sense! Can anyone tell me how I would program that, I can only find how to enter values on the leading diagonal and not any other diagonals. It is a 71x71 matrix so I cannot enter it manually!</p>