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 smc.vnet.net
  • Subject: [mg83673] Re: Create random binary images
  • From: Szabolcs Horvát <szhorvat at gmail.com>
  • Date: Wed, 28 Nov 2007 05:27:50 -0500 (EST)
  • References: <figtob$f90$1@smc.vnet.net>

Tara.Ann.Lorenz at gmail.com 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
> 

RandomChoice[{5,95}->{1,0}, {30, 30}]

-- 
Szabolcs


  • Prev by Date: Rationalize
  • Next by Date: Re: Create random binary images
  • Previous by thread: Re: Create random binary images
  • Next by thread: Re: Create random binary images