Mercurial > hg > ishara
annotate general/cellutils/cellmap.m @ 53:3ba80c9914ff
Minor doc fix, added .class to .hgignore
author | samer |
---|---|
date | Mon, 02 Feb 2015 10:47:55 +0000 |
parents | 03694e5c8365 |
children |
rev | line source |
---|---|
samer@4 | 1 function Y=cellmap(fn,X) |
samer@4 | 2 % cellmap - Map a function over a cell array |
samer@4 | 3 % |
samer@13 | 4 % cellmap :: (A->B, {[Size]->A}) -> {[Size]->B}. |
samer@4 | 5 |
samer@4 | 6 % preallocate to fix size |
samer@4 | 7 Y=cell(size(X)); |
samer@4 | 8 for i=1:numel(X) |
samer@7 | 9 Y{i}=fn(X{i}); |
samer@4 | 10 end |