convert from datenum to a date

18 ビュー (過去 30 日間)
Rica
Rica 2012 年 11 月 15 日
コメント済み: Fercho_Sala 2021 年 4 月 16 日
Hi,
is ther any function which convert the serial number from the function (detenum) to the original date like .
I have a vector of date and time and i converted it with datenum. I made a plot of another variable with the date_time vector. i get just the serial number.
thnks

採用された回答

Jan
Jan 2012 年 11 月 15 日
編集済み: Jan 2012 年 11 月 15 日
Please post any details. What format does "the original date" have? What does "I made a plot" exactly mean and where do you want the "date" to appear?
The command datestr and datevec convert datenum values to other date formats. The command datetick writes nice dates instead of serial date numbers to the ticklables of axes.

その他の回答 (2 件)

Rica
Rica 2012 年 11 月 15 日
Hi! the goal was to select 200 data from i big data. i took the time as a parameter
and converted it with datenum.
i wanted to plot the variation of selected measured data with the (date and time)
it will be for me nice to show also the date and time un the plot not only the converted eith datenum.
if true
%
date= time=
'1.2.2010' '1:2:59'
'2.2.2010' '2:3:50'
'5.2.2010' ......
... .......
... .....
.... .....
i converted them with datnum
converted=datenum(date)+datenum(time)
thanky

Andreas Svedin
Andreas Svedin 2016 年 7 月 5 日
If you use "datenum" on a datetime array and want to get it converted back to datetime use the command below. It seem to work
"datetime(datestr(dates))"
  2 件のコメント
Peter Perkins
Peter Perkins 2016 年 8 月 3 日
Or more directly: datetime(dates,'ConvertFrom','datenum')
Fercho_Sala
Fercho_Sala 2021 年 4 月 16 日
@Peter Perkins good answer, but it does't separe in one colum dates and in other column hours, how do you do it?

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeDates and Time についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by