Declaration: AddupLayers(FirstLayer, LastLayer, TSlot: integer; var DataMat: TDouble2DArray; InitDataMat, NormalizeData: boolean): integer;
Adds up all layers between FirstLayer and LastLayer of the data cube at the time slot TSlot and adds the sum to the matrix DataMat. The parameter InitDataMat controls whether the matrix DataMat should be initialized to zero values before calling the function AddupLayers. The parameter NormalizeData determines whether the summed data should be divided by the number of layers before adding the sum to the matrix DataMat.

The function returns the following error codes:

 0 ... everything is OK
-1 ... FirstLayer or LastLayer is out of range
-2 ... TSlot out of range