Two "Time" colunm in a time table

1 Ansicht (letzte 30 Tage)
Alvaro Persichini
Alvaro Persichini am 18 Jun. 2019
Bearbeitet: Peter Perkins am 19 Jun. 2019
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.

Akzeptierte Antwort

Peter Perkins
Peter Perkins am 19 Jun. 2019
Bearbeitet: Peter Perkins am 19 Jun. 2019
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.

Weitere Antworten (0)

Kategorien

Mehr zu Tables finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by