Borrar filtros
Borrar filtros

Selecting random number from martrix

1 visualización (últimos 30 días)
Pat
Pat el 9 de Nov. de 2011
I have a matrix of 10rows and 10 columns,i want to select 5 rows randomly ,please help

Respuesta aceptada

signal
signal el 9 de Nov. de 2011
one way to do it is
row = randperm(10);
row = row(1:5);
result = your_matrix(row,:);

Más respuestas (0)

Categorías

Más información sobre Random Number Generation en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by