random pick cell array
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
how to randomly picking in cell array? for example,i want to pick randomly one data in x.
x=[1;8;9;10;16]
0 commentaires
Réponses (1)
Paulo Silva
le 7 Mai 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
0 commentaires
Voir également
Catégories
En savoir plus sur Matrices and Arrays dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!