Quantcast
Channel: MATLAB Central Newsreader Recent Posts
Viewing all articles
Browse latest Browse all 19628

Re: Random Matrix help

$
0
0
"Steven_Lord" <slord@mathworks.com> wrote in message <km8qs6$4jt$1@newscl01ah.mathworks.com>...

> % The odds of that happening are so small I'm going to neglect this step for
> the example

I propose to remove the chance of oddity entirely, and furthermore gaining some speed by using RAND rather than RANDN.

n = 5;
A = triu(2*round(rand(n))-1,1);
A = A + A'

% Bruno

Viewing all articles
Browse latest Browse all 19628

Trending Articles