How do I add a time column in the format of YYYY-MM-DD to my table?

조회 수: 5 (최근 30일)
Saunok Chakrabarty
Saunok Chakrabarty 2023년 4월 3일
댓글: Jon 2023년 4월 10일
I have a table containing time series data of some macroeconomic variables. My data is quarterly, starting from 1947-01-01 and ending on 2022-10-01. However, MATLAB is representing these dates numerically - eg, 1947-01-01 shows up as -725846400, after I imported the file into MATLAB from R. How do I change the time column to quarterly data in the range that I want?

채택된 답변

Jon
Jon 2023년 4월 3일
편집: Jon 2023년 4월 3일
I think R stores dates as posix time.
You can use something like this to convert to datetime format eg 31-Dec-1969 23:59:56
d = datetime(-725846400, 'ConvertFrom', 'posixtime')
  댓글 수: 5

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Dates and Time에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by