Re: Create random binary images
- To: mathgroup at smc.vnet.net
- Subject: [mg83724] Re: [mg83637] Create random binary images
- From: Carl Woll <carlw at wolfram.com>
- Date: Thu, 29 Nov 2007 06:21:25 -0500 (EST)
- References: <200711271105.GAA15599@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
>
>
Use RandomChoice. For example:
RandomChoice[{5, 95} -> {1, 0}, {30, 30}]
Carl Woll
Wolfram Research
- References:
- Create random binary images
- From: Tara.Ann.Lorenz@gmail.com
- Create random binary images