/usr/share/freemat/toolbox/string/upper.m is in freemat-data 4.0-5build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | % UPPER UPPER Convert strings to upper case
%
% Usage
%
% The upper function converts a string to upper case with
% the syntax
%
% y = upper(x)
%
% where x is a string, in which case all of the lower case
% characters in x (defined as the range 'a'-'z') are
% converted to upper case. Alternately, you can call upper
% with a cell array of strings
%
% y = upper(c)
%
% in which case each string in the cell array is converted to upper case.
% Copyright (c) 2002-2007 Samit Basu
% Licensed under the GPL
function y = upper(x)
if (isstr(x))
y = upper_string(x);
elseif (iscell(x))
y = cell(size(x));
for i=1:numel(x)
y{i} = upper_string(x{i});
end
else
y = x;
end
function y = upper_string(x)
if (isstr(x))
y = string(x + ('A'-'a')*(x>='a' && x<='z'));
else
y = x;
end;
|