annotate general/cellutils/cmapaccum.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@13 1 function [Y,s]=cmapaccum(fn,s,X)
samer@13 2 % cmapaccum - Map a function over a cell array
samer@13 3 %
samer@13 4 % cmapaccum :: (A,S->B,S), S, {[Size]->A}) -> {[Size]->B}, S.
samer@13 5
samer@13 6 % preallocate to fix size
samer@13 7 Y=cell(size(X));
samer@13 8 for i=1:numel(X)
samer@13 9 [Y{i},s]=fn(X{i},s);
samer@13 10 end