Effacer les filtres
Effacer les filtres

how do you ask matlab for a random word from dictionary?

4 vues (au cours des 30 derniers jours)
zoom
zoom le 2 Mai 2019
Réponse apportée : KSSV le 2 Mai 2019
randWord=randi(length(dictionary));
i tried using the code above and it gives me number instead of a word from the dictionary

Réponse acceptée

KSSV
KSSV le 2 Mai 2019
idx=randperm(length(dictionary),1);
randword = dictionary{idx}

Plus de réponses (0)

Catégories

En savoir plus sur Creating and Concatenating Matrices 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!

Translated by