Two "Time" colunm in a time table

1 vue (au cours des 30 derniers jours)
Alvaro Persichini
Alvaro Persichini le 18 Juin 2019
Modifié(e) : Peter Perkins le 19 Juin 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.

Réponse acceptée

Peter Perkins
Peter Perkins le 19 Juin 2019
Modifié(e) : Peter Perkins le 19 Juin 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.
  1 commentaire
Alvaro Persichini
Alvaro Persichini le 19 Juin 2019
Ok. Clear. thank you!

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Tables dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by