how to transform a time-serie data non uniform to uniform
조회 수: 5 (최근 30일)
이전 댓글 표시
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
댓글 수: 0
채택된 답변
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.
추가 답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!