# how to transform a time-serie data non uniform to uniform

조회 수: 5 (최근 30일)
Win co 2012년 3월 17일
Hi everyone, I have a time-serie data as input of a system ex: day = [1 2 4 6 7 8 10 11 14 15 16 19 20 21 22 23 24 25 26 27 28 29 30] and an output with the same length. I would like to use these input and ouput vector to train an ANFIS (adaptive neuro-fuzzy inference system). The problem is the quantity of data as input is not enough for training so I want to make it uniform like that day = [1 2 3 4 5 6 7 8 9 ... 30] the data as output for additional days will be computed by interpolation Does anyone know whether it exists a command in Matlab to solve this problem ? Thanks

댓글을 달려면 로그인하십시오.

### 채택된 답변

per isakson 2012년 3월 17일
Try this
day = [1 2 4 6 7 8 10 11 14 15 16 19 20 21 22 23 24 25 26 27 28 29 30];
y = rand( 1, numel(day) );
day_uni = (1:1:30);
y_uni = interp1( day, y, day_uni );
plot( day, y, 'd', day_uni, y_uni, '+' )
and lookup interp1 in the online help. There are several interpolation methods. Default is linear.
##### 댓글 수: 1이전 댓글 -1개 표시이전 댓글 -1개 숨기기
Win co 2012년 3월 28일
this is the great answer. thanks alot
Winn

댓글을 달려면 로그인하십시오.

### 카테고리

Help CenterFile Exchange에서 Interpolation에 대해 자세히 알아보기

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by