samer@13: function X=cfoldl(fn,e,args) samer@13: % cfoldl - Fold fom the left combinator for cell arrays samer@13: % samer@13: % foldl :: (X,Y->X), X, cells(Y) -> X. samer@13: % samer@13: % This function applies a folding function to cell array, samer@13: % starting from the left using the given starting element. samer@13: % eg cfoldl(@plus,0,{1,2,3,4}) = ((((0+1)+2)+3)+4). samer@13: X=e; for i=1:length(args), X=fn(X,args{i}); end