Selecting random number from martrix

I have a matrix of 10rows and 10 columns,i want to select 5 rows randomly ,please help

 Akzeptierte Antwort

signal
signal am 9 Nov. 2011

0 Stimmen

one way to do it is
row = randperm(10);
row = row(1:5);
result = your_matrix(row,:);

Weitere Antworten (0)

Kategorien

Mehr zu Random Number Generation finden Sie in Hilfe-Center und File Exchange

Gefragt:

Pat
am 9 Nov. 2011

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by