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 function

Subject: random function

From: amira ali

Date: 6 Sep, 2012 10:03:08

Message: 1 of 3



hello
 i have image dataset splitting to training data and testing data , i want to select training images randomely

say trainging data is (img1,img2 ,.............................,img 50)




how can i do that

Subject: random function

From: Maxim Vedenev

Date: 6 Sep, 2012 10:42:15

Message: 2 of 3

Use randperm function. Say 20 random numbers from 1-50:
p = randperm(50); % random sorted 1...50
r=p(1:20); % some 20 numbers from 1...50 without repeats

-----------------------------------------
Maxim Vedenev, MATLAB Custom Programming
vedenev@ngs.ru
http://simulations.narod.ru/

Subject: random function

From: amira ali

Date: 6 Sep, 2012 11:45:08

Message: 3 of 3

Maxim Vedenev <vedenev.maxim@gmail.com> wrote in message <ec729be7-c237-4fdd-a592-aab6c642c39d@googlegroups.com>...
> Use randperm function. Say 20 random numbers from 1-50:
> p = randperm(50); % random sorted 1...50
> r=p(1:20); % some 20 numbers from 1...50 without repeats
>
> -----------------------------------------
> Maxim Vedenev, MATLAB Custom Programming
> vedenev@ngs.ru
> http://simulations.narod.ru/
thanks

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