diff scripts/strings/upper.m @ 5676:9c9eac3a6513

[project @ 2006-03-16 04:09:07 by jwe]
author jwe
date Thu, 16 Mar 2006 04:09:07 +0000
parents 2618a0750ae6
children 75a828280d68
line wrap: on
line diff
--- a/scripts/strings/upper.m
+++ b/scripts/strings/upper.m
@@ -19,8 +19,9 @@
 
 ## -*- texinfo -*-
 ## @deftypefn {Function File} {} upper (@var{s})
-## Transform all letters in the string @var{s} to upper case.
-## @seealso{toupper}
+## Transform all letters in the character string (or cell array of
+## character strings) @var{s} to upper case.
+## @seealso{lower, tolower, toupper}
 ## @end deftypefn
 
 ## Author: jwe
@@ -31,6 +32,15 @@
     usage ("upper (s)");
   endif
 
-  retval = toupper (s);
+  if (ischar (s))
+    retval = toupper (s);
+  elseif (iscellstr (s))
+    retval = cell (size (s));
+    for i = 1:(numel (s))
+      retval{i} = toupper(s{i});
+    endfor
+  else
+    error ("upper: `s' must be a string or cell array of strings");
+  endif
 
 endfunction