I've never done any programming before so excuse me if what I'm asking is too simple to even be asked. I'm trying to construct a random nxn matrix that is symmetric and has entries of either 1 or -1 on the off-diagonals and 0s on the diagonal. Something tells me this is really easy but I can't figure it out.
I have this so far
n=5; A=rand(n); A=(A+A')/2; round(A)
But this only gives me entries of either 0 or 1 and I cannot figure out what to do to make the entries on the diagonal 0s.