Version

AverageIf(ComplexVector,BooleanVector) Method

Returns the average value of the ComplexVectorx where the corresponding BooleanVector is True.
Syntax
'Declaration
 
Public Overloads Shared Function AverageIf( _
   ByVal x As ComplexVector, _
   ByVal comparison As BooleanVector _
) As Complex
public static Complex AverageIf( 
   ComplexVector x,
   BooleanVector comparison
)

Parameters

x
A ComplexVector.
comparison
A BooleanVector with the same length and orientation as x.

Return Value

The average value of the elements of x where comparison is true.
Exceptions
ExceptionDescription
System.ArithmeticException Occurs if the comparison has a different length than x.
System.ArithmeticException Occurs if the comparison has a different orientation than x.
Remarks
The BooleanVector comparison can be easily constructed using the compare operators on ComplexVector. The following notation is convenient: Complex i = Constant.I; ComplexVector x1 = Compute.Line(-1, 1, 1000) + i*Compute.Line(1, -1, 1000); Complex sum = Compute.AverageIf(x, x > 0);
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also