Skip to content
Back to formatted view

Raw Message

Message-ID: <6ade6f6c0612101222k45b24f1av9a454534989885a@mail.gmail.com>
Date: 2006-12-10T20:22:43Z
From: Paul Smith
Subject: sample "n" random positions from a matrix
In-Reply-To: <687436.75963.qm@web56612.mail.re3.yahoo.com>

On 12/10/06, Milton Cezar Ribeiro <milton_ruser at yahoo.com.br> wrote:
>   I have a binary matrix (dim 100x100) filled with values 0 and 1. I need select a record "n" positions of that matrix when values are 1. How can I do that?

Do you mean extracting the indexes of n randomly chosen elements of
the matrix which are equal to one?

Paul