How to extract sequences from a table?
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
James McBrearty
am 22 Aug. 2023
Kommentiert: James McBrearty
am 22 Aug. 2023
Hi All,
I am adapting the example by Mathworks, Sequence Classification using Deep Learning,, to work with my own problem.
I have the raw data coming in as a table, and I'm wondering is there a way to split this up into sequences, based on the values in one column, rather than an arbitrary number of rows down?
My table looks like this:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1462492/image.jpeg)
What I would like to do is to convert this to a cellarray, of various double arrays (from this picture above it will be x cells each with 2*y double arrays, however, the real table has a few more columns, so it's just an extension of this).
Many thanks,
James
4 Kommentare
the cyclist
am 22 Aug. 2023
Can you upload the data, or a small representative sample? You can use the paper clip icon in the INSERT section of the toolbar.
Akzeptierte Antwort
Matt J
am 22 Aug. 2023
Bearbeitet: Matt J
am 22 Aug. 2023
Calling your table T,
out = splitapply(@(x){x} , T{:,[1:10,12:end]},findgroups(T.tradeDate))
6 Kommentare
Dyuman Joshi
am 22 Aug. 2023
"Was there something wrong with the format of the dates?"
The format hid additional information of the datetime values.
The dates might look identical, but the values for hour, minute and seconds were different for the same day. You can check that by using hms.
So, to make the data uniform, all the dates have been shifted to the start of the respective days i.e. 00:00:00
Siehe auch
Kategorien
Mehr zu Calendar 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!