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 smc.vnet.net
  • Subject: [mg83694] Re: Create random binary images
  • From: Albert Retey <awnl at arcor.net>
  • Date: Wed, 28 Nov 2007 05:40:00 -0500 (EST)
  • References: <figtob$f90$1@smc.vnet.net>

Hi,

> 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?
> 
would that be what you are after?

ArrayPlot[Clip[
   RandomReal[{0, 1}, {30, 30}],
   {0.95, 0.95}, {0, 1}
   ]]


albert


  • Prev by Date: Re: Mathematica 6.0 Desperation
  • Next by Date: Re: Discrepancy between Integrate and NIntegrate
  • Previous by thread: Re: Create random binary images
  • Next by thread: Re: Create random binary images