comparison scripts/strings/upper.m @ 6023:75a828280d68

[project @ 2006-10-03 02:14:21 by jwe]
author jwe
date Tue, 03 Oct 2006 02:14:21 +0000
parents 9c9eac3a6513
children 34f96dd5441b
comparison
equal deleted inserted replaced
6022:abd750456740 6023:75a828280d68
33 endif 33 endif
34 34
35 if (ischar (s)) 35 if (ischar (s))
36 retval = toupper (s); 36 retval = toupper (s);
37 elseif (iscellstr (s)) 37 elseif (iscellstr (s))
38 retval = cell (size (s)); 38 retval = cellfun (@toupper, s, "UniformOutput", false);
39 for i = 1:(numel (s))
40 retval{i} = toupper(s{i});
41 endfor
42 else 39 else
43 error ("upper: `s' must be a string or cell array of strings"); 40 error ("upper: `s' must be a string or cell array of strings");
44 endif 41 endif
45 42
46 endfunction 43 endfunction