필터 지우기
필터 지우기

Extract data from Timetable on specified whole integer minutes . i.e. extract data every 6 minutes. Trying to use retime function.

조회 수: 2 (최근 30일)
dt = minutes(6);
TT2 = retime(TT1,'regular','linear','TimeStep',dt)
%TT1 is a time table which also contains NaT and NaN values.
  댓글 수: 2
Steven Lord
Steven Lord 2023년 6월 19일
That looks like a line of code that will do what you described in the question. From the fact that you're asking about it on MATLAB Answers I presume it didn't behave as you expected. What did you expect it to do and what did it actually do?
PADMAKAR
PADMAKAR 2023년 6월 19일
이동: Stephen23 2023년 6월 19일
I keep getting this error. Dont understand why. The row times are shown in attached jpg file.
Error using timetable/retime
Input timetables must contain unique row times when synchronizing using 'linear'.
Error in RTKFiles_May (line 83)
TT2 = retime(tempFile,'regular','linear','TimeStep',dt);

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

답변 (1개)

dpb
dpb 2023년 6월 19일
이동: dpb 2023년 6월 19일
Your time variable is only dates and, as the error message says, to use retime this way the time vector has to be unique for each observation.
You either
  1. Didn't record the actual time of the observation, or
  2. Didn't read the time information when creating the table if was recorded, or
  3. The appropriate time would be that associated with the start of the record plus the duration data in the second colum.
We've no way to know which of those choices is the correct one, but on the assumption it's the third, then first read the data into a regular table and add the duration to the date to get the actual start time (if the data go over one day, you'll have to adjust for that, howeve).
Without further amplification, won't try specific code; if you need further help attach the actual data with the paperclip icon instead of posting images; not anything can do with them.
  댓글 수: 1
Peter Perkins
Peter Perkins 2023년 7월 17일
Right, as dpb hints, you have daily data and are trying to retime it to 6min steps. You'd need to interpolate to do that, and you can, but if your data have multiple values on each date, interpolation is not allowed. I think dpb's 3'rd guess and suggestion is correct.

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

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by