PsiLAB Help Manual Page

Section: Basic Matrix functions

Name: matop2

Evaluate for each matrix element of matrix a the function f and store the result in the matrix b. The target matrix b must be already allocated.

func:('a -> 'a) a:('a, 'b, 'c) Matrix.t b:('a, 'b, 'c) Matrix.t sub:(int * int) list

Additionaly to matop , a sub range can be specified for each dimension of the matrix a. An empty sub range list indicates the full matrix size. The function must be of the form y=f(x). The matrix can be of one of the supported matrix types:
[ int float complex ]

[] let f = fmatrix ~const:[1.0,2.0,3.0;4.0,5.0,6.0] () ;; 
[] let sinfmat = fmatrix ~dim:[2;3] () ;; 
[] matop2 sin f sinfmat [];; 

Printed by PsiLAB