Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Random Numbers from a Matrix

Subject: Random Numbers from a Matrix

From: Anthony

Date: 15 Sep, 2010 17:02:11

Message: 1 of 3

Is there a way to randomly select numbers from a matrix?
For example, using randi and returning random numbers (integers) only from the matrrix
[2 6 9 13 42 ], etc.

Subject: Random Numbers from a Matrix

From: Sean

Date: 15 Sep, 2010 17:16:05

Message: 2 of 3

"Anthony" <anthony.campos@baesystems.com> wrote in message <i6qu6j$87s$1@fred.mathworks.com>...
> Is there a way to randomly select numbers from a matrix?
> For example, using randi and returning random numbers (integers) only from the matrrix
> [2 6 9 13 42 ], etc.

hints:
help randsample
help randperm

Subject: Random Numbers from a Matrix

From: Paul Hanson

Date: 30 Sep, 2010 18:37:04

Message: 3 of 3

> hints:
> help randsample
> help randperm

HOLY handgrenades! LOVE these hints, they are just what I was looking for to my problem! Thanks!

cheers and beers,
Paul

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us