/usr/share/freemat/toolbox/array/ishandle.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 | % ISHANDLE ISHANDLE Test for Graphics Handle
%
% Usage
%
% Given a constant, this routine will test to see if the
% constant is a valid graphics handle or not. The syntax
% for its use is
%
% y = ishandle(h,type)
%
% and returns a logical 1 if x is a handle of type type
% and a logical 0 if not.
% Copyright (c) 2002-2006 Samit Basu
% Licensed under the GPL
function b = ishandle(handle,type)
if (isstr(handle))
b = false;
return;
end
if (strcmp(type,'figure') && (handle<=100))
b = logical(1);
return;
end
if ((handle<=100000) || (handle ~= int32(handle)))
b = logical(0);
return;
end
b = logical(0);
try
b = strcmp(get(handle,'type'),type);
catch
end
|