function result = hasProperty(h, propToCheck)
% Returns index of the property if it exists, 0 otherwise

%   Copyright 2010 The MathWorks, Inc.
result = false;
if isempty(propToCheck) || isempty(h.Properties)
    return;
end
result = ~isempty(find(strcmpi(get(h.Properties,'Name'), propToCheck), 1));