MATLAB Answers

how to convert date to numbers

조회 수: 3(최근 30일)
Boss Man
Boss Man 25 Feb 2020
댓글: Star Strider 25 Feb 2020
so i have 200 dates on my data from 1st october....
i wanted to know if there was a trick to numbering the dates,
e.g. making 1st october=1
2nd october=2 etc

  댓글 수: 6

표시 이전 댓글 수: 3
Boss Man
Boss Man 25 Feb 2020
e.g.01-04-2019
however when i call them by xlsread im left with an empty matrix
Boss Man
Boss Man 25 Feb 2020
fixed the date problem with readtable,it displays the date now
i now get this error when using day(t)
Undefined function 'day' for input arguments of type 'table'.
dpb
dpb 25 Feb 2020
The variable t is your table; NOT the date variable inside the table. If it is named something original like 'Date', say, then
da=day(t.Date);

로그인 to comment.

채택된 답변

Star Strider
Star Strider 25 Feb 2020
I showed you how to read them and do other operations on them in: How to combine date and time.
That also converts them to date numbers, and from there you can number them as you wish. The integer part of a date number are days, and the fractional parts are fractions of a day.

  댓글 수: 2

Boss Man
Boss Man 25 Feb 2020
thanks :)
Star Strider
Star Strider 25 Feb 2020
As always, my pleasure!

로그인 to comment.

추가 답변(0개)

이 질문에 답변하려면 로그인을(를) 수행하십시오.

태그


Translated by