samer@4: function Y=cellmap(fn,X) samer@4: % cellmap - Map a function over a cell array samer@4: % samer@13: % cellmap :: (A->B, {[Size]->A}) -> {[Size]->B}. samer@4: samer@4: % preallocate to fix size samer@4: Y=cell(size(X)); samer@4: for i=1:numel(X) samer@7: Y{i}=fn(X{i}); samer@4: end