Code covered by the BSD License  

Highlights from
cellfunfun

cellfunfun

by

 

cellfunfun is identical to cellfun but takes care for uniformOutput parameter

cellfunfun(varargin)
function varargout = cellfunfun(varargin)
% cellfunfun is identical to cellfun with one improvement: you don't need
% to add that annoying (...,'uniformOutput','false') in the end, if it is
% necessary. In case it is not necessary, the function operates as if
% 'uniformOutput','true'. You can also explicitly set ''uniformOutput' to
% the value you wish
varargout = cell(nargout,1);
try
    if nargout > 0
        [varargout{:}] = cellfun(varargin{:});
    else
        cellfun(varargin{:})
    end
catch
    if nargout > 0
        [varargout{:}] = cellfun(varargin{:}, 'uniformOutput',false);
    else
        cellfun(varargin{:}, 'uniformOutput',false)
    end
    
end

Contact us