From: Idon Havone on
How to write a function that generates a random 5 digit name?
From: Ross W on
"Idon Havone" <idonhavone(a)yahoo.com> wrote in message <i44igo$lt1$1(a)fred.mathworks.com>...
> How to write a function that generates a random 5 digit name?

hi

how about this?

name_length=5;

list=char(abs('a'):abs('z')); %one way of getting 'abcdefg ...xyz'

random_indices=randi(numel(list),1,name_length); %read the help for randi

random_name=list(random_indices);

Ross
From: Wayne King on
"Idon Havone" <idonhavone(a)yahoo.com> wrote in message <i44igo$lt1$1(a)fred.mathworks.com>...
> How to write a function that generates a random 5 digit name?

Hi Idon, are you just trying to produce 5 random letters? Another way is

char(randi([97 122],1,5))

Just using the ASCII character codes for the Latin alphabet (lower case). Of course if you wanted to add constraints that there has to be a vowel, or no more than a fixed number of consonants together, then things are more complicated.

Wayne