Mercurial > hg > ishara
annotate general/cellutils/cellmap.m @ 61:eff6bddf82e3 tip
Finally implemented perceptual brightness thing.
author | samer |
---|---|
date | Sun, 11 Oct 2015 10:20:42 +0100 |
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 |