/usr/share/psychtoolbox-3/PsychGamma/CheckMonotonic.m is in psychtoolbox-3-common 3.0.11.20131230.dfsg1-1build1.
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 | function bool = CheckMonotonic(vector)
% bool = CheckMonotonic(vector)
%
% Check whether the passed vector is monotonically non-decreasing.
%
% Return 1 if so, 0 if not.
[m,n] = size(vector);
diff = vector(1:m-1) - vector(2:m);
index = find(diff > 0);
if (~isempty(index))
bool = 0;
else
bool = 1;
end
|