/usr/share/psychtoolbox-3/PsychBasic/psychlasterror.m is in psychtoolbox-3-common 3.0.11.20140816.dfsg1-1.
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 40 41 42 43 44 45 46 47 48 49 50 | function rc = psychlasterror(varargin)
% psychlasterror - Replacement for Matlab-7 'lasterror'.
% This is hopefully useful for older Matlab installations and
% for the Octave port:
%
% If the 'lasterror' variable, M-File or builtin function
% is supported on your Matlab installation, this function
% will return it.
%
% Otherwise, this function will return the older lasterr
% variable instead.
% exist must check for all cases, as lasterror is implemented differently
% on different Matlab versions (variable, M-File or builtin-function):
if exist('lasterror') > 0 %#ok<EXIST>
% Call Matlab implementation:
if nargin > 0
try
rc = lasterror(varargin{1});
catch
% This catches bugs in lasterror on Matlab 7.0 itself!
% Doesn't recognize the 'reset' keyword!
try
if strcmpi(varargin{1}, 'reset')
lasterr('');
else
lasterr(varargin{1});
end
catch
% The climax of sadness!
end
end
else
rc = lasterror;
end
else
% Use our simple fallback-implementation:
rc.message = lasterr;
rc.identifier = '';
if nargin > 0
if strcmpi(varargin{1}, 'reset')
lasterr('');
else
lasterr(varargin{1});
end
end
end
return;
|