So I'm working on a project and I'm totally stuck right now on how to generate an nxn matrix in Matlab (where n is defined by user input).  I need to make a matrix that has ones diagonally, zeroes below it, and values of negative one above.  As a 2x2 example shown right here:[1 -10  1] I would show the code that I have, but I'm blank on how to make it actually do that.  I know how to get it to accept user input.  I also figure that nested for loops may be able to work here, because if I could generate an nxn matrix with values I can set, I can have two variables, like r and c (rows and columns).  For the diagonal, where r=c the values can equal 1, -1 where r is less than c, and 0 where r is greater than c.  Problem is I'm not sure how to generate a matrix where you can set values in it like that.  I know you can generate an identity matrix with the 'eye' command, but that just has the diagonal values equal to 1.  I can give more information, but if there's some command for that I'm missing, I could really use to know.  Thank you.
How to make a certain matrix in Matlab
matrices