Borrar filtros
Borrar filtros

random pick cell array

3 visualizaciones (últimos 30 días)
Sahab
Sahab el 7 de Mayo de 2011
how to randomly picking in cell array? for example,i want to pick randomly one data in x.
x=[1;8;9;10;16]

Respuestas (1)

Paulo Silva
Paulo Silva el 7 de Mayo de 2011
x=[1;8;9;10;16]; %is one array not cell array
x(randi([1 numel(x)])) %show one random element of the array

Categorías

Más información sobre Creating and Concatenating Matrices 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