function neg=isneg(str) Inputs: str - A character string, of the form '-12:00:01' Outputs: neg - true (1) if the string appears to contain a negative number false (0) if the string does not appear to contain a negative number (EML)
0001 function neg=isneg(str) 0002 0003 % function neg=isneg(str) 0004 % 0005 % Inputs: 0006 % 0007 % str - A character string, of the form '-12:00:01' 0008 % 0009 % Outputs: 0010 % 0011 % neg - true (1) if the string appears to contain a negative number 0012 % false (0) if the string does not appear to contain a negative number 0013 % 0014 % (EML) 0015 0016 for i=1:size(str,2) 0017 if(~isspace(str(i))) 0018 neg = str(i)=='-'; 0019 return 0020 end 0021 end 0022 0023 end