PsiLAB Help Manual
High level matrix functions
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.
mat:(Complex.t, 'a, 'b) Matrix.t
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.
 let c = cmatrix ~dim:[5;3] ~rand:[1.0] () ;;
 write_cmat "test.dat" c () ;;
 let cr = read_cmat "test.dat" () ;;
Printed by PsiLAB