How to select a one random letter from a matrix of letters.
4 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Giuseppe
il 2 Apr 2014
Commentato: Arjun P Kumar
il 25 Set 2020
I have the array.
move = [R ,P, S]
How would I select a random letter from this array.
cmove = ?
Would it look something like this ?:
cmove = move(rand(numel(move)))
0 Commenti
Risposta accettata
Azzi Abdelmalek
il 2 Apr 2014
Modificato: Azzi Abdelmalek
il 2 Apr 2014
move = {'R' ,'P', 'S'}
cmove = move(randi(numel(move)))
or
move ='RPS'
cmove = move(randi(numel(move)))
2 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Logical in Help Center e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!