Borrar filtros
Borrar filtros

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

4 visualizaciones (últimos 30 días)
zoom
zoom el 2 de Mayo de 2019
Respondida: KSSV el 2 de Mayo de 2019
randWord=randi(length(dictionary));
i tried using the code above and it gives me number instead of a word from the dictionary

Respuesta aceptada

KSSV
KSSV el 2 de Mayo de 2019
idx=randperm(length(dictionary),1);
randword = dictionary{idx}

Más respuestas (0)

Categorías

Más información sobre Creating and Concatenating Matrices en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by