Main
Home
Quick tour
Documentation
Mailing Lists
Demonstration
Download
Sourceforge project
FAQ
History
Links


Toolboxes
Char
Control
Crypto
Finance
FunFun
General
Graphics
Image
Internal
InputOutput
LinearAlgebra
Matrix
Miscellaneous
Net
Polynomial
Set
Signal
SpecFun
SpecialMatrix
Statistics
String
System
Time
Trigonometric
...


Contact
Developers

JMathLib
A Java Clone of Octave, SciLab, Freemat and Matlab.

[Index] [Documentation] [Demonstration] [Download]

sum

Type: External

Group: matrix

Syntax

answer = sum(matrix)
answer = sum(structure)

Description

Returns the sum of all the elements of a matrix or a structure.

Examples

sum([1,2;3,4]) = 10
sum([1,2,3;4,5,6]) = 21
x=struct(a, 1, b, 2, c, 3) = a = 1 : b = 2 : c = 3 :
sum x = 6

See Also

trace, diag

Last modified
SourceForge Logo