Or simpler problem I am having. I decided to separate the while loop into two while loops. In the first one I am checking if the user enter a alphabetic character first.
% Asking user to input the variable Out1=input(['Enter the beginning point of the domain = '],'s'); Out2=input(['Enter the ending point of the domain = '],'s');
Out1=str2num(Out1); sK1=size(Out1); % if OUT1 is not a number, sK1 will be 0 by 0 sK1=sK1(1); Out2=str2num(Out2); sK2=size(Out2); % if OUT2 is not a number, sK2 will be 0 by 0 sK2=sK2(1); while (sK1==0) (sK2==0)
Out1=input(['Enter the starting point of the domain = '],'s');
Out2=input(['Enter the ending point of the domain = '],'s');
Out1=str2num(Out1);
sK1=size(Out1);
sK1=sK1(1);
Out2=str2num(Out2);
sK2=size(Out2);
sK2=sK2(1);
end
This does not work ..but if I check 1 by 1 it does work ..I dont understand why.
Any suggestion?