 <p>For an object, you'd use <code>get</code>, not <code>getfield</code> (or dynamic access in a loop like you showed).</p> <pre><code>&gt;&gt; h = figure; &gt;&gt; get(h,{'Position','Renderer'}) ans = [1x4 double] 'opengl' </code></pre> <p>This doesn't work for all objects, but for MATLAB graphics objects it does work. To deal with any class, you can use your function, but with a custom cell output instead of <code>varargout</code>:</p> <pre><code>function C = getProps(object,propnames) for p = 1:numel(propnames), C{p} = object.(propnames{p}); end </code></pre> <p>Then inside whatever function you write, you can get a comma-separated list of all properties with <code>C{:}</code>, which will be suitable for a function that expects each property name input as a separate argument (e.g. <code>C = getProps(myObj,propnames); x = myFun(h,C{:})</code>.</p>