I have a GUIDE GUI where I ask the user to enter in their name. It should execute an error dialog if they enter numerical characters, a mix of string and numerical characters, or a blank box.
The issue is that when I enter in numbers or a mix of string and numerical characters, then it is outputting Error Code II
(1st elseif
statement) instead of Error Code III
(entering in numbers only) or Error Code IV
(entering numbers and strings). Input would be greatly appreciated.
Here's essentially what I have:
if isempty(editString)
errordlg('Please enter a name into the text-box. We thank you in anticipation.',...
'Error Code I');
return
elseif char(editString) > 12
errordlg('Please enter a name that is less than 12 characters long. Thank you.',...
'Error Code II');
return
elseif isa(editString, 'integer')
errordlg('Please enter a name, not numbers. Thank you.', 'Error Code III');
return
elseif isa(editString, 'integer') && isa(editString, 'char')
errordlg('Please enter a name without mixing numbers & characters. Thanks.',...
'Error Code IV');
else
delete(gcf)
gui_02
end