The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Software » comp.soft-sys.matlab

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Random Matrix help
Replies: 3   Last Post: May 6, 2013 2:40 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]

Posts: 1
Registered: 5/6/13
Random Matrix help
Posted: May 6, 2013 12:27 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

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


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.


Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.