関数sequence_absmaxindex マニュアル

(The documentation of function sequence_absmaxindex)

Last Update: 2021/12/8


◆機能・用途(Purpose)

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


◆形式(Format)

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


◆引数(Arguments)

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


◆戻り値(Return value)

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

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