MATLAB: How do you ask matlab for a random word from dictionary

randomvector

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

Best Answer

idx=randperm(length(dictionary),1);
randword = dictionary{idx}