Two "Time" colunm in a time table

1 回表示 (過去 30 日間)
Alvaro Persichini
Alvaro Persichini 2019 年 6 月 18 日
編集済み: Peter Perkins 2019 年 6 月 19 日
Hello I have two groups of "Dates", one is the "buy-date" and the other is the "sell-date"
I want to add this two "rowTime" to a timetable. But timetables admits just one rowTime
The following code, doesn't work.
Buy_Dates = datetime(BuyDate);
Sell_Dates = datetime(SellDate);
TT_Trades = table2timetable(T_Trades, 'RowTimes', Buy_Dates, 'RowTimes', SellDate);
Thank you.

採用された回答

Peter Perkins
Peter Perkins 2019 年 6 月 19 日
編集済み: Peter Perkins 2019 年 6 月 19 日
Correct, there is only one vector of times to label the rows of a timetable. But that's not to say you can't put both vectors in a timetable, just that only one of them can be the "row times". Just add the other one as an ordinary timetable variable, on the same footing as T_Trades.
The row times in a table are special because those are the ones used for subscripting by time. I can't say which of your two vectors is the more "fundamental" one, or which one should be the row times. Maybe neither one is more fundamental, so maybe you want a table (not a timetable) two of whose variables are datetime vectors. But I would think you'd want to make a timetable and choose one of the two as your row times.
  1 件のコメント
Alvaro Persichini
Alvaro Persichini 2019 年 6 月 19 日
Ok. Clear. thank you!

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeTables についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by