ONLINE HELPFOR WINDEV, WEBDEV AND WINDEV MOBILE Version: 151617181920212223
 Home | Sign in | English
• Number of elements found in a matrix row or in a matrix column
• Managing the errors
WINDEV
WEBDEV
WINDEV Mobile
Others
StatAverage (Function)
In French: StatMoyenne
Calculates the arithmetic, geometric or harmonic mean for a series of values.
Versions 18 and later
This function is now available in Windows Store apps mode.
New in version 18
This function is now available in Windows Store apps mode.
This function is now available in Windows Store apps mode.
Versions 19 and later
This function is now available for the iPhone/iPad applications.
New in version 19
This function is now available for the iPhone/iPad applications.
This function is now available for the iPhone/iPad applications.
Versions 21 and later
This function is now available in Universal Windows 10 App mode.
New in version 21
This function is now available in Universal Windows 10 App mode.
This function is now available in Universal Windows 10 App mode.
Versions 23 and later
This function is now available in Android Widget mode.
This function is now available for the Android applications.
This function is now available for the Java applications.
New in version 23
This function is now available in Android Widget mode.
This function is now available for the Android applications.
This function is now available for the Java applications.
This function is now available in Android Widget mode.
This function is now available for the Android applications.
This function is now available for the Java applications.
// Arithmetic mean of the elements in row 1 of a matrix
ResAverage = StatAverage("MyMatrix", statArithmetic, 1 , False)
Syntax
<Result> = StatAverage(<Matrix Name> [, <Type of Mean> [, <Row/Column Number> [, <Row/Column>]]])
<Result>: Real
Mean for the series.
<Matrix Name>: Character string (with quotes)
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 statGeometric Geometric mean statHarmonic Harmonic 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 find out whether errors have been generated by this function, use StatError. To find out the error details, use ErrorInfo associated with the errMessage constant.
Related Examples:
 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
 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
 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
Components
wd230mat.dll
wp230mat.dll
wd230java.jar
wd230mat.so
wd230android.jar
Minimum required version
• Version 9
This page is also available for…
 Comments
 Click [Add] to post a comment
 Registered trademarks. Copyright ©2009-2018 PC SOFT. All rights reservedThis website has been developed with WEBDEV and HFSQLWEBDEV, WINDEV Mobile and WINDEV programming