annotate general/cellutils/cmapaccum.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@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
|