Mathematica 9 is now available
Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2005

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Matrix question

  • To: mathgroup at
  • Subject: [mg60302] Re: [mg60287] Matrix question
  • From: Bob Hanlon <hanlonr at>
  • Date: Sat, 10 Sep 2005 22:36:21 -0400 (EDT)
  • Reply-to: hanlonr at
  • Sender: owner-wri-mathgroup at

n = 5; p = 0.3;
Table[If[Random[] < p, Random[], 0], {n}, {n}]

Bob Hanlon

> From: sandog <sandog at>
To: mathgroup at
> Date: 2005/09/10 Sat AM 06:46:37 EDT
> Subject: [mg60302] [mg60287] Matrix question
> i want to create a NxN matrix with zeros but i want a percentage of the 
matrix spots to be one at random spots any idea? cause i have no clue how to 
do that.
> Any help appreciated thx .

  • Prev by Date: Re: Matrix question
  • Next by Date: Re: Matrix question
  • Previous by thread: Re: Matrix question
  • Next by thread: Re: Matrix question