How to select a random number from a matrix

Réponses (1)

Guillaume
Guillaume le 25 Avr 2019
Use randi to select an index at random:
A(randi(numel(A)))

Catégories

En savoir plus sur Random Number Generation dans Centre d'aide et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by