converting irregular space data into regular spaced data for time line interpolation
이전 댓글 표시
HI i was given a dataset that has irregular spaced time and temperature.I am now struggling to do a time series linear interpolation since i dont know how to create a regularly spaced on hour time series from the data given. for example vq = interp1(x,v,xq,method,extrapolation);
i have the values for x and v but not xq. so how do i get the regular spaced data?
%%load data
A = load('../data2/Q1_data.txt');
B = load('../data2/Q2_data.txt');
C = load('../data2/Q3_data.txt');
D = load('../data2/Q4_data.txt');
%%Question 1 interpolation
a_date = (A(:,1));
a_temp = (A(:,2));
a_hourly = ?
A_linear = interp1(a_date, a_temp, min(a_hourly):max(a_hourly), 'linear', 'extrap');
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Interpolation에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!