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