Mercurial > hg > plml
annotate matlab/db/dbcellmap.m @ 37:89688ebc447f tip
Deprecating this repository.
author | samer |
---|---|
date | Mon, 05 Jan 2015 17:42:03 +0000 |
parents | a1094b51a6c4 |
children |
rev | line source |
---|---|
samer@36 | 1 function Y=cellmap(fn,X) |
samer@36 | 2 % cellmap - Map a function over a cell array |
samer@36 | 3 % |
samer@36 | 4 % cellmap :: (A->B, {[Size]->A}) -> {[Size]->B} |
samer@36 | 5 |
samer@36 | 6 % preallocate to fix size |
samer@36 | 7 Y=cell(size(X)); |
samer@36 | 8 for i=1:numel(X) |
samer@36 | 9 Y{i}=feval(fn,X{i}); |
samer@36 | 10 end |