table to timetable conversion problems

조회 수: 1 (최근 30일)
roberto
roberto 2023년 7월 1일
댓글: roberto 2023년 7월 1일
the problem arises after the conversion (T=table2timetable(TICKTYPE); . I attach the sparkline of the "TICKTYPE" table preview and the succesive sparkline "T" in the timetable. the "x_BID_" column has strange horizontal lines that change the values of subsequent data processing like tt= retime(T,'regular','mean','TimeStep',seconds(10)); here the mean values are completely different from the values of "T" file.tks very much. I also attach the T file in .mat

채택된 답변

Cris LaPierre
Cris LaPierre 2023년 7월 1일
You have only shared a subset of your data, so we are not able to reproduce the issue. However, I suspect what has happened is your timetable is creaed using time of day, and your full dataset is from multiple days. The timetable uses the time information to create the sparkline, but since your rowtimes do not include date, the data from multiple days now overlap based on time only. I suggest creating a datetime column by combining time and date, and use that as your rowtimes.
Perhaps something like this:
TICKTYPE.DT = datetime(TICKTYPE.x_DATE_,'InputFormat','yyyy.MM.dd')+TICKTYPE.x_TIME_
T = table2timetable(TICKTYPE,"RowTimes","DT")
  댓글 수: 1
roberto
roberto 2023년 7월 1일
tks very much Cris LaPierre! now works perfectly

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

추가 답변 (0개)

카테고리

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

제품


릴리스

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by