Two "Time" colunm in a time table

1 visualización (últimos 30 días)
Alvaro Persichini
Alvaro Persichini el 18 de Jun. de 2019
Editada: Peter Perkins el 19 de Jun. de 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.

Respuesta aceptada

Peter Perkins
Peter Perkins el 19 de Jun. de 2019
Editada: Peter Perkins el 19 de Jun. de 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.

Más respuestas (0)

Categorías

Más información sobre Tables en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by