functionnumberOfRealZeros
Determine the number of elements of a Complex vector where the imaginary part is zero
Extends from Modelica.Icons.Function (Icon for functions).
Information
Syntax
Matrices.numberOfRealZeros(complexVector);
Description
Function numberOfRealZeros(..) determines the number of elements of vector "complexVector" with vanishing imaginary part, i.e., complexVector[i].im = 0.
Example
// c = {0, 1+2*j, 1-2*j, 2, -3, -1-1*j, -1+1*j};
result = Matrices.numberOfRealZeros(c);
// result = 3;
Inputs
| Type | Name | Default | Description |
|---|---|---|---|
| Complex[:] | complexVector | Complex vector |
Outputs
| Type | Name | Default | Description |
|---|---|---|---|
| Integer | result | Number of elements of v with v.im = 0 |