PsiLAB Help Manual Page

Section: Basic Matrix functions

Name: matsum

Calculate the sum of a matrix. .Nl This function calculates the sum of all the values from the elements of the given matrix a.
Supported data formats:
[ int float complex ]

In the case of complex values, the real and imaginary parts are summed idependently.

[ sum:'a ] = matsum
mat:('a,'b,'c) Matrix.t

[] let f = fmatrix ~const:[1.0,2.0,3.0;4.0,5.0,6.0] () ;; 
[] matsum f ;; 
- : float = 21 

Printed by PsiLAB