home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 10 / 10.iso / l / l460 / 2.ddi / STRFUN.DI$ / UPPER.M < prev   
Encoding:
Text File  |  1993-03-07  |  434 b   |  19 lines

  1. function A = upper(a)
  2. %UPPER    Convert string to upper case.
  3. %    A = upper(a) converts any lower case characters in a to
  4. %    the corresponding upper case character and leaves all
  5. %    other characters unchanged.
  6. %
  7. %    See also LOWER.
  8.  
  9. %    Copyright (c) 1984-93 by The MathWorks, Inc.
  10.  
  11. oldflops = flops;
  12. if ~isstr(a)
  13.     A = a;
  14. else
  15.     mask = ((a >= 'a') & (a <= 'z'));
  16.     A = setstr(a + ('A' - 'a')*mask);
  17. end
  18. flops(oldflops);
  19.