Filter löschen
Filter löschen

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

4 Ansichten (letzte 30 Tage)
zoom
zoom am 2 Mai 2019
Beantwortet: KSSV am 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

Akzeptierte Antwort

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

Weitere Antworten (0)

Kategorien

Mehr zu Creating and Concatenating Matrices finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by