% Field value of each object in an array or cell array.
%
% See also: getfield

% Copyright 2010 Levente Hunyadi
function values = getclassfield(objects, field)

values = cell(size(objects));
if iscell(objects)
    for k = 1 : numel(values)
        values{k} = objects{k}.(field);
    end
else
    for k = 1 : numel(values)
        values{k} = objects(k).(field);
    end
end

CovertLab
github-repos/MATLAB/CovertLab-WholeCell/WholeCell-6cdee6b355aa0f5ff2953b1ab356eea049108e07/lib/propertygrid/getclassfield.m
WholeCell
github-repos/MATLAB/CovertLab-WholeCell
6cdee6b355aa0f5ff2953b1ab356eea049108e07