Home > matutils > mosaic > isneg.m

isneg

PURPOSE ^

function neg=isneg(str)

SYNOPSIS ^

function neg=isneg(str)

DESCRIPTION ^

 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)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

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

Generated on Sun 14-Jun-2015 17:12:45 by m2html © 2005