関数sequence_maxindex マニュアル

(The documentation of function sequence_maxindex)

Last Update: 2021/12/8


◆機能・用途(Purpose)

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


◆形式(Format)

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


◆引数(Arguments)

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


◆戻り値(Return value)

seq.valueの配列要素の最大値に対応する配列要素番号。
The index of the array component corresponding to the maximum 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 max_index=sequence_maxindex(seq);

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