AnEmptyString = '';
str2double(AnEmptyString)
When you str2double() something empty, you get NaN, not empty. You need to check the result of the get() if you want to distinguish between the user entering nothing, or the user entering 'NaN', or the user entering something that is not number-like.