/usr/share/freemat/toolbox/test/keyfunc.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 | function c = keyfunc(a,b,operation,printit)
if (~isset('a') | ~isset('b'))
error('keyfunc requires at least the first two 2 arguments');
end;
if (~isset('operation'))
% user did not define the operation, default to '+'
operation = '+';
end
if (~isset('printit'))
% user did not specify the printit flag, default is false
printit = 0;
end
% simple operation...
eval(['c = a ' operation ' b;']);
if (printit)
printf('%f %s %f = %f\n',a,operation,b,c);
end
|