The SDL Component Suite is an industry leading collection of components supporting scientific and engineering computing. Please visit the SDL Web site for more information....



MeanArray


Unit:SDL_openarrays
Class: none
Declaration: [1] function MeanArray (Arr: TIntArray; ElemLo, ElemHi: integer; var Mean: double): integer;
[2] function MeanArray (Arr: TInt2DArray; ColLo, RowLo, ColHi, RowHi: integer; var Mean: double): integer;
[3] function MeanArray (Arr: TInt3DArray; ColLo, RowLo, LayerLo, ColHi, RowHi, LayerHi: integer; var Mean: double): integer;
[4] function MeanArray (Arr: TInt4DArray; ColLo, RowLo, LayerLo, TSlotLo, ColHi, RowHi, LayerHi, TSlotHi: integer; var Mean: double): integer;
[5] function MeanArray (Arr: TDoubleArray; ElemLo, ElemHi: integer; var Mean: double): integer;
[6] function MeanArray (Arr: TDouble2DArray; ColLo, RowLo, ColHi, RowHi: integer; var Mean: double): integer;
[7] function MeanArray (Arr: TDouble3DArray; ColLo, RowLo, LayerLo, ColHi, RowHi, LayerHi: integer; var Mean: double): integer;
[8] function MeanArray (Arr: TDouble4DArray; ColLo, RowLo, LayerLo, TSlotLo, ColHi, RowHi, LayerHi, TSlotHi: integer; var Mean: double): integer;

The function MeanArray calculates the mean of the values of the given array Arr within the specified range. This range is specified by the given integer values ElemLo, ColLo, RowLo, LayerLo, and TSlotLo, which represent together the first index in the range, and ElemHi, ColHi, RowHi, LayerHi, and TSlotHi, representing the last indices of the range. The calculated mean is returned in the variable parameter Mean.

The function returns the following error codes:

 0 ... everything is OK
-1 ... the array Arr has zero size
-2 ... one of the parameters is out of range



Last Update: 2023-Feb-06