view general/cellutils/cellmap.m @ 13:03694e5c8365

Reorganised some high order list functions to correct class-based method dispatch; fixed some docs.
author samer
date Wed, 16 Jan 2013 12:12:34 +0000
parents 47cb292350f3
children
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}=fn(X{i});
end