関数sequence_minindex マニュアル

(The documentation of function sequence_minindex)

Last Update: 2021/12/8


◆機能・用途(Purpose)

時系列データの最小値を探し、対応するサンプル番号を返す。
Search the minimum value of a time series data, and return the index of the corresponding sample.


◆形式(Format)

#include <sequence/statistics.h>
inline int sequence_minindex(struct sequence seq)


◆引数(Arguments)

seq 最小値を探索したい時系列データを表す構造体。
A structure to represent the time series data for which the minimum value is to be searched.


◆戻り値(Return value)

seq.valueの配列要素の最小値に対応する配列要素番号。
The index of the array component corresponding to the minimum value of seq.value.


◆使用例(Example)

struct sequence =get_sequence_memory(8,0.0,0.1);
seq.value[0]=1.0;
seq.value[1]=3.0;
seq.value[2]=-5.0;
seq.value[3]=2.0;
seq.value[4]=0.0;
seq.value[5]=-4.0;
seq.value[6]=2.5;
seq.value[7]=-1.5;
int min_index=sequence_minindex(seq);

この例ではmin_index=2となる。
In this example, the value of min_index is 2.