ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Standard functions / Numeric values functions / Statistical functions
  • Number of elements found in a matrix row or in a matrix column
  • Managing the errors
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
StatAverage (Function)
In french: StatMoyenne
Calculates the arithmetic, geometric or harmonic mean for a series of values.
// Arithmetic mean of the elements in row 1 of a matrix
ResAverage = StatAverage("MyMatrix", statArithmetic, 1 , False)
Syntax
<Result> = StatAverage(<Matrix> [, <Type of mean> [, <Row/Column number> [, <Row/Column>]]])
<Result>: Real
Mean for the series.
<Matrix>: Character string
Name of the matrix containing the data, defined by MatCreate.
<Type of mean>: Optional constant
Specifies the type of mean to calculate:
statArithmetic
(Default value)
Arithmetic mean
statGeometricGeometric mean
statHarmonicHarmonic mean
<Row/Column number>: Optional integer
Number of the row or column containing the data (1 by default).
<Row/Column>: Optional boolean
  • True (by default) if the series of values corresponds to a matrix column,
  • False if the series of values corresponds to a matrix row.
Remarks

Number of elements found in a matrix row or in a matrix column

The number of elements found in a matrix row or in a matrix column is taken as a reference. This number of elements corresponds to:
  • the total number of matrix rows, returned by MatNbLine (if the calculation is performed on a column),
  • the total number of matrix columns, returned by MatNbColumn (if the calculation is performed on a row).
If the series contain less elements than the matrix, the missing values are automatically filled with 0. These values are taken into account during the calculations.

Managing the errors

Caution: StatAverage returns no error code. To determine if this function has generated errors, use StatError. To get more details on the error, use ErrorInfo with the errMessage constant.
Related Examples:
The Stat functions Unit examples (WINDEV): The Stat functions
[ + ] Using the main functions for statistical calculations (using matrices):
- Calculate a sum of values
- Calculate a mean of values
- Find the minimum value in a set of values
- Find the maximum value in a set of values
The Stat functions Unit examples (WINDEV Mobile): The Stat functions
[ + ] Using the main functions for statistical calculations (using matrices):
- Calculate a sum of values
- Calculate a mean of values
- Find the minimum value in a set of values
- Find the maximum value in a set of values
The Stat functions Unit examples (WEBDEV): The Stat functions
[ + ] This example presents the main functions for statistical calculations (using matrices) of WEBDEV and it allows you to:
- Calculate a sum of values
- Calculate an average of values
- Find the minimum value in a series of values
- Find the maximum value in a series of values
Business / UI classification: Neutral code
Component: wd290mat.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 06/22/2023

Send a report | Local help