view general/cellutils/cellmap.m @ 4:e44f49929e56

Adding reorganised general toolbox, now in several subdirectories.
author samer
date Sat, 12 Jan 2013 19:21:22 +0000
parents
children 47cb292350f3
line wrap: on
line source
function Y=cellmap(fn,X)
% cellmap - Map a function over a cell array
%
% cellmap :: (A->B, {[Size]->A}) -> {[Size]->B}

% preallocate to fix size
Y=cell(size(X));
for i=1:numel(X)
	Y{i}=feval(fn,X{i});
end