PsiLAB Help Manual Page

Section: Basic Matrix functions

Name: dim

Return the dimension sizes of a matrix .
This function returns a new matrix with the sizes for each dimension of the argument matrix.
[ sizes:(int, 'b, 'c) Matrix.t ] = dim
mat:('a, 'b, 'c) Matrix.t

Example:
[] let f = fmatrix ~dim:[5;4;3] () ;; 
val f : (float, '_a, '_b) Matrix.t = <abstr> 
[] let fsize = dim f ;; 
val fsize : (int, '_a, '_b) Matrix.t = <abstr> 
[] fsize.{0} ;; 
- : int = 5 
[] fsize.{1} ;; 
- : int = 4 
[] fsize.{2} ;; 
- : int = 3 

Printed by PsiLAB