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

7 次查看(过去 30 天)
randWord=randi(length(dictionary));
i tried using the code above and it gives me number instead of a word from the dictionary

采纳的回答

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

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Sources 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by