CELLSUM Sum of each element a cell array, possibly weighted. S=CELLSUM(X) where X is a cell array of N arrays, is equivalent to S(1,1)=SUM(X{1}(:)), S(2,1)=SUM(X{2}(:)), ..., S(N,1)=SUM(X{N}(:)) thus returning an N x 1 array containing the sum over all values of each element in the cell array. In taking the sum, non-finite values are ignored, as in VSUM. S is a column vector of the same length as X. [S1,S2,...,SP]=CELLSUM(X1,X2,...,XP) also works for P different input arguments. CELLSUM(X1,X2,...XP); with no output arguments overwrites the original input variables. __________________________________________________________________ Weighted sums CELLSUM(X,'weight',W) or CELLSUM(X1,X2,...,XP,'weight',W) where W is a cell array of the same size as the other input variables, computes the weighted sum, using the weighting factor ABS(W).^2. __________________________________________________________________ Parallelization CELLSUM(...,'parallel') parallelizes the computation using a PARFOR loop. This requires that Matlab's Parallel Computing Toolbox be installed, and is useful for very large datasets. __________________________________________________________________ See also CELLSTD, CELLMED, JCELL. Usage: s=cellsum(x); [s1,s2,s3]=cellsum(x1,x2,x3); cellsum(x1,x2,x3,'weight',w); cellsum(x1,x2,x3); cellsum(x1,x2,x3,'parallel'); __________________________________________________________________ This is part of JLAB --- type 'help jlab' for more information (C) 2014--2019 J.M. Lilly --- type 'help jlab_license' for details