PsiLAB Help Manual Page

Section: High level matrix functions

Name: write_cmat

Write a complex matrix in fortran format to a file.
This function writes a complex vector or matrix (2 dim) to a file in fortran format. The first line of the file contains the matrix description.
write_cmat
file:string
mat:(Complex.t, 'a, 'b) Matrix.t
?header:bool
()

The header can be avoided if the header argument is set to false.
Format of the header line:
complex < matrix dimension > < number of rows > < number of columns >

In the case of a vector, the last value is set to zero (!), and the dimension is 1.
Example:

[] let c = cmatrix ~dim:[5;3] ~rand:[1.0] () ;; 
[] write_cmat "test.dat" c () ;; 
[] let cr = read_cmat "test.dat" () ;; 

Printed by PsiLAB