MATLAB: How to restrict a text input to letters

inputlettersrestricttext;

How can I restrict a text input to uppercase and lowercase letters? I have this : new_user.username = input('Username: ', 's');

Best Answer

Here's one way, taking advantage of the isletter command:
new_user.username = 0;
while ~all(isletter(new_user.username))
new_user.username = input('Username: ', 's');
end