Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive

MathGroup Archive 2007

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

Search the Archive

Re: Create random binary images

  • To: mathgroup at
  • Subject: [mg83663] Re: Create random binary images
  • From: dh <dh at>
  • Date: Wed, 28 Nov 2007 05:21:52 -0500 (EST)
  • References: <figtob$f90$>

Hi Tara,

in version 6 we have RandomSample that can take weights. We may choose 

this to get one number with the weights you want. Using "Table" we then 

get the array:


we can visualize this:

Graphics[Raster[t]] //Show

hope this helps, Daniel

Tara.Ann.Lorenz at wrote:

> Hello,


> I am trying to create several random binary images of 30x30.  I want

> the outputs to be 1's and 0's, with 5% of the outputs being 1's.  Any

> ideas on how to code this in Mathematica?


> Thanks!

> Tara


  • Prev by Date: Re: Stream programming
  • Next by Date: Re: Trying to create a clustered StackedBarChart
  • Previous by thread: Re: Create random binary images
  • Next by thread: Re: Create random binary images