Borrar filtros
Borrar filtros

could anyone help me how to randomly select the values.

1 visualización (últimos 30 días)
jaah navi
jaah navi el 5 de Jun. de 2019
Respondida: Alex Mcaulley el 5 de Jun. de 2019
I am having
b= 1
3
4
5
8
9
10
11
13
15
I want to randomly select any 5 values from b and i need it to display it in single row
i used the command randi(b,1,5)
but unable to get the result.
could anyone please help me on it.

Respuesta aceptada

Alex Mcaulley
Alex Mcaulley el 5 de Jun. de 2019
Try this:
res = b(randi(numel(b),1,5))';

Más respuestas (0)

Categorías

Más información sobre Get Started with MATLAB 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