PsiLAB Help Manual
Page
Section:
Basic Matrix functions
Name:
imatrix_get_byname
Get a matrix by name
This function concatenates an already allocated matrix (with the imatrix_byname function) with a Psilab (Caml) variable, identified by a unique name string.
[ mat:(int, 'a, 'b) Matrix.t ] = imatrix_get_byname
name:string
?fill:float list
?rand:float list
?copy:(int, 'a, 'b) Matrix.t list
?const:'a list
()
The fill argument can be used to fill the matrix with a constant value. The rand list argument initializes all matrix elements with a random number, those maximal value is determined by this argument. The copy list argument can be used to copy the content of another matrix to this matrix. And finally, the const argument can be used to initialite this matrix with either a constant vector or a constant 2 dimensional matrix.
See also imatrix_byname.
Example:
(* allocate a new matrix named "mymatrix" *)
[] imatrix_byname ~dim:[100;100] ~create:["mymatrix"] ();;
[] let iv () =
(* imat gets the matrix *)
let imat = imatrix_get_byname "mymatrix" () in
...
(* if the matrix is no longer used: *)
[] imatrix_byname ~destroy:["mymatrix"] () ;;
Printed by PsiLAB