functionFindMultiExtremum
Information
FindMultiExtremum returns a vector containing the n (where n <N) extreme values of the input vector X and their indexes.
Hypothesis and equations
This function takes as input :
- a vector X made of N real values,
- n, the number of extreme values to extract from the vector X
- The boolean ascending, to set if extreme values wanted are the smallest ones (=true) or the greatest ones (=false)
FindMultiExtremum returns a vector Xm contenant les n (où n < N) containing the n (where n < N) extreme values of the input vector X and the vector Indm containing their indexes in the vector X.
Bibliography
none
Instructions for use
u = {1, 3, 4, 5, 4, 3}
(X,Ind)=FindMultiExtremum(X=u,n=4,ascending=false)
Declaring variable: Real X [4];
Declaring variable: Integer Ind [4];
X = {5.0, 4.0, 4.0, 3.0}, Ind = {4, 3, 5, 2}
Known limits / Use precautions
none
Validations
Validated function - Gilles Plessis, Hassan Bouia 06/2012
--------------------------------------------------------------
Licensed by EDF under a 3-clause BSD-license
Copyright © EDF 2009 - 2023
BuildSysPro version 3.6.0
Author : Gilles PLESSIS, Hassan BOUIA, EDF (2012)
--------------------------------------------------------------
Inputs
| Type | Name | Default | Description |
|---|---|---|---|
| Integer | n | Number of extreme values to extract to the vector X | |
| Real | X | Vector of reals | |
| Boolean | ascending | false |
Outputs
| Type | Name | Default | Description |
|---|---|---|---|
| Real[n] | Xm | Ordered extreme values of the vector X | |
| Integer[n] | Indm | Corresponding indexes in the vector X |
Revisions
Benoît Charrier 01/2016 : Adaptation pour compatibilité avec OpenModelica