clear; clc;

x = input('Enter x? ', 's');
w = str2num(x);
% if isempty(w)
%     disp([x, ' is not a number.']);
% else
%     if w >= 0
%         sqrt(w)
%     else
%         disp([x, ' is not a nonnegative number.']);
%     end
% end

if isempty(w)
    disp([x, ' is not a number.']);
elseif w >= 0
    sqrt(w)
else
    disp([x, ' is not a nonnegative number.']);
end