function PublicProps = allprops(obj)
% Returns list of all public properties (visible or hidden).
% Note: PROPERTIES does not include hidden public properties like 'u'.

%   Copyright 1986-2021 The MathWorks, Inc.
mc = metaclass(obj);  % get meta.class
PP = findobj([mc.Properties{:}], 'GetAccess', 'public');
PublicProps = {PP.Name};
