converting column of datetimes in excel to datenumbers in matlab

3 ビュー (過去 30 日間)
Jubilee Sibanda
Jubilee Sibanda 2020 年 7 月 13 日
編集済み: Mehmed Saad 2020 年 7 月 15 日
hie everyone
I want to convert data in column C (labeled datetime) of the attached document to a column of date numbers in matlab, which are to be used as input variables for a neural network
please help

採用された回答

Mehmed Saad
Mehmed Saad 2020 年 7 月 13 日
編集済み: Mehmed Saad 2020 年 7 月 13 日
T = readtable('zetdctestdata.xlsx');
T.datetime = cellfun(@(x)datenum(x,'mm/dd/yyyy HH:MM:SS'),T.datetime);
  5 件のコメント
Jubilee Sibanda
Jubilee Sibanda 2020 年 7 月 14 日
and how do i stop matlab from rounding off the outputs in the columns i get 7.3708e+05 instead of 737076.458333333
Mehmed Saad
Mehmed Saad 2020 年 7 月 15 日
編集済み: Mehmed Saad 2020 年 7 月 15 日
Actual value in variable is 737076.458333333 but due to format it is rounding off
The default format for command window is Short
T.datetime(1)
ans =
7.3708e+05
Change Format to long
format Long
T.datetime(1)
ans =
7.370764583333334e+05
But it is just for display purpose

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

その他の回答 (0 件)

カテゴリ

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