Path: news.mathworks.com!not-for-mail
From: "Ulrik Nash" <uwn@sam.sdu.dk>
Newsgroups: comp.soft-sys.matlab
Subject: random sample of n rows from matrix
Date: Mon, 14 Dec 2009 13:41:07 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 13
Message-ID: <hg5f9j$nrl$1@fred.mathworks.com>
Reply-To: "Ulrik Nash" <uwn@sam.sdu.dk>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1260798067 24437 172.30.248.35 (14 Dec 2009 13:41:07 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 14 Dec 2009 13:41:07 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 2106050
Xref: news.mathworks.com comp.soft-sys.matlab:592521

I have the following code:

m = [1 23, 2 34, 3 45, 4 43]

Now I want to draw a random sample of n rows from m.

I have tried the following:

sample = m(randperm(n))

but I only get values from the first column.

What is the correct proceedure?