Difference between revisions of "Cell/totsum.m"

From Spinach Documentation Wiki
Jump to: navigation, search
(Normalise sequential blank lines)
Line 29: Line 29:
  
 
[[Appendix_H:_Matlab_object_overloads|Matlab object overloads]]
 
[[Appendix_H:_Matlab_object_overloads|Matlab object overloads]]
−
 
  
 
''Version 2.9, authors: [[Ilya Kuprov]]''
 
''Version 2.9, authors: [[Ilya Kuprov]]''

Revision as of 11:23, 25 April 2026

A sum across all dimensions of a cell array.

Syntax

    S=totsum(A)

Arguments

    A - a cell array of numerical objects

Outputs

    S - the sum of all elements in A

Examples

>> totsum({1,2,sparse(3)}')

ans =

   (1,1)        6

Notes

If all elements of A are sparse, a sparse result will be returned.

See also

cell/minus.m, cell/plus.m, cell/mtimes.m

Matlab object overloads

Version 2.9, authors: Ilya Kuprov