Working with tables that are within a timetable
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Hi there,
I have a 10x1 timetable. Each row in that timetable is another table with the list of positions (rows), and their properties (columns) for those dates.
I need to work with that data, for example, create another timetable with only the positions for which one of the properties is equal to X.
But I'm not able to tacke the tables.
The code I had was: D = TT.Issue{:,Column10==FIX};
Is not working, nor: D = TT.Issue.Column10=='FIX';
Can someone help please?
0 comentarios
Respuestas (1)
J. Alex Lee
el 3 de En. de 2020
Editada: J. Alex Lee
el 3 de En. de 2020
I would first flatten the table, especially if you will be making many queries. Something like
DataCell = cell(height(TT),1);
For i=1:height(TT)
t = TT{i,"Issue"};
T.Time = repmat(TT.Time(i), height(TT),1)
DataCell{i} = t;
end
Data = vertcat(DataCell{:})
Then query as a usual table
RowMask = Data.Column10=='FIX'
NewTable = Data(RowMask,:)
The rowmask line may fail if column10 is not of type categorical
4 comentarios
J. Alex Lee
el 4 de En. de 2020
Yes, you might consider typing your columm10 as a categorical if it makes sense.
Data.Column10 = categorical(Data.Column10)
Ver también
Categorías
Más información sobre Tables en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!