Matlab Random Word Generator
Afficher commentaires plus anciens
Hi All,
I have been attempting to generate a singular random word, from a set of words in a txt file labelled: dictionary.txt
So far, my code is as follows:
Dictionary="dictionary.txt";
Random=randperm(length("dictionary.txt"),1);
randword = Dictionary{Random}
However, when i run the code, it returns:
randword =
'dictionary.txt'
How can i make it so that the code displays a random word within the dictionary.txt file, rather than the file name?
Kind Regards,
Smoxk x
Réponse acceptée
Plus de réponses (0)
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!