function property = getProperty(h, prop)
% Returns  property if it exists, empty handle otherwise

%   Copyright 2010 The MathWorks, Inc.
if nargin > 1
    prop = convertStringsToChars(prop);
end

property = [];
if ~h.hasProperty(prop)
    return;
end
index = find(strcmpi(get(h.Properties, 'Name'), prop));
if ~isempty(index)
    property = h.Properties(index);
end