resampling data into equal intervals

조회 수: 3 (최근 30일)
C.G.
C.G. 2022년 2월 14일
댓글: C.G. 2022년 2월 14일
I have a dataset (attached) which has been sampled at unequal intervals, but for processing I need to resample this to every second.
The timestamps for each data point are in column 1, and the data in column 2.
I have looked at the information on resample on matlab help, but i'm struggling to work out how to do this for my dataset. Can anybody help?

채택된 답변

Simon Chan
Simon Chan 2022년 2월 14일
Try function retime
TT1=readtimetable('dataset.txt');
TT2 = retime(TT1,'secondly','linear'); % You may choose other method other than 'linear'
head(TT2,10) % Showing first 10 data
ans = 10×2 timetable
Time mass tare _______________________ ________ ____ 2022-02-08 20:04:12.000 0.55425 0 2022-02-08 20:04:13.000 0.46354 0 2022-02-08 20:04:14.000 0.31349 0 2022-02-08 20:04:15.000 0.27578 0 2022-02-08 20:04:16.000 0.44176 0 2022-02-08 20:04:17.000 -0.56104 0 2022-02-08 20:04:18.000 1.1503 0 2022-02-08 20:04:19.000 0.76525 0 2022-02-08 20:04:20.000 0.37981 0 2022-02-08 20:04:21.000 0 0
  댓글 수: 1
C.G.
C.G. 2022년 2월 14일
Thank you! I didn't know about retime

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

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by