Path: news.mathworks.com!not-for-mail
From: "ade77 " <ade100a@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: -extract 120X9 matrix from 1000X9 matrix randomly
Date: Tue, 9 Feb 2010 16:45:05 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 14
Message-ID: <hks3eh$46u$1@fred.mathworks.com>
References: <hks11k$ti$1@fred.mathworks.com>
Reply-To: "ade77 " <ade100a@gmail.com>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1265733905 4318 172.30.248.35 (9 Feb 2010 16:45:05 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 9 Feb 2010 16:45:05 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1059495
Xref: news.mathworks.com comp.soft-sys.matlab:605807


"muk " <hungocan@hotmail.com> wrote in message <hks11k$ti$1@fred.mathworks.com>...
> Hello all,
> 
> Now, i have 1000X9 matrix which is quality parameters. And, i want to extract 120X9 matris randomly from 1000x9 matrix.
> How can i do that?
> 
> Sincerely, 

Like Walter suggested, randperm seems to be your easiest way.

your_matrix = 1000 by 9
h = randperm(1000);
g = h(1:120);
rand_array = your_matrix(g,:);