Azzera filtri
Azzera filtri

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

4 visualizzazioni (ultimi 30 giorni)
randWord=randi(length(dictionary));
i tried using the code above and it gives me number instead of a word from the dictionary

Risposta accettata

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

Più risposte (0)

Categorie

Scopri di più su Creating and Concatenating Matrices in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by