DataLab is a compact statistics package aiming at exploratory data analysis. Please visit the DataLab Web site for more information....


Declaration: MatrixDivElem (Mat1, Mat2: TDouble2DArray; Wgt, Offs: double; var TargetMat: TDouble2DArray): integer;
Divides the matrix Mat1 by the Mat2 elementwise. The elements of matrix Mat2 can be offset by the parameter Offs. The Wgt parameter can be used to scale the result according to the following equation:

TargetMat[] := Wgt * Mat1[] / (Mat2[] + Offs)

The results are stored in the matrix TargetMat. The function returns the following error codes:

 0 ... everything is OK
-1 ... Mat1 and Mat2 do not match in size
>0 ... count of "division by zero" situations; the corresponding element of the target matrix is left unchanged if a division by zero occurs