home *** CD-ROM | disk | FTP | other *** search
/ Borland Programmer's Resource / Borland_Programmers_Resource_CD_1995.iso / utils / mathstud / strcmp.m < prev    next >
Encoding:
Text File  |  1995-05-19  |  315 b   |  17 lines

  1. function r = strcmp(s,t)
  2. %r=strcmp(s,t)
  3. %string comparison (takes care of string arrays)
  4. %COMPATIBILITY: MATLAB 3.5 doesn't compare 2D string arrays
  5.  
  6. %       S.Halevy 7/31/92
  7. %       Copyright (c) 1992 by the MathWizards
  8.  
  9. r = 0;
  10. sz=size(s);
  11. tz=size(t);
  12. if sz==tz
  13.    r = (s==t);
  14.    r=all(r(:));
  15. end
  16.  
  17.