#
PsiL_{A}B Help Manual
Page

## Section:
Basic Matrix functions

## Name:
cmatrix_get_byname

**Get a matrix by name **

This function concatenates an already allocated matrix (with the *cmatrix_byname *function) with a Psilab (Caml) variable, identified by a unique name string.

[ mat:(Complex.t, 'a, 'b) Matrix.t ] = **cmatrix_get_byname **

name:string

?fill:Complex.t list

?rand:float list

?copy:(Complex.t, 'a, 'b) Matrix.t list

?const:'a list

()

The *fill *list 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 *list argument can be used to initialite this matrix with a constant vectors. The complex elements are written as tuples (re,im).

See also *cmatrix_byname. *

Example:

(* allocate a new matrix named "mymatrix" *)
[] cmatrix_byname ~dim:[100;100] ~create:["mymatrix"] ();;
[] let iv () =
(* cmat gets the matrix *)
let cmat = cmatrix_get_byname "mymatrix" () in
...
(* if the matrix is no longer used: *)
[] cmatrix_byname ~destroy:["mymatrix"] () ;;

Printed by PsiL_{A}B