Synchronize timetables stored in a structure
9 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Giovanni Barbarossa
am 30 Jul. 2023
Kommentiert: Giovanni Barbarossa
am 31 Jul. 2023
I have a structure S with N fields F_1 to F_N. Each field stores a timetable T_1 to T_N, respectively. How do I synchronize the timetables and keep them in the same structure?
4 Kommentare
Walter Roberson
am 30 Jul. 2023
I am not currently convince that you want to synchronize().
I suspect that what you want to do is to retime() all of them to the same timestamps (the ones available for T_1)
Akzeptierte Antwort
Walter Roberson
am 30 Jul. 2023
One possible interpretation of your question:
Sc = struct2cell(S);
joint = sortrows(vertcat(Sc{:}));
synchronized = structfun(@(F) synchronize(F, joint, 'union'), S, 'uniform', 0);
This (tries to) synchronize each of the timetables against all of the other ones, by combining all of them together into one and synchronizing against that.
2 Kommentare
Walter Roberson
am 31 Jul. 2023
NT1 = S.T_1.Properties.RowTimes;
Retimed = structfun(@(F) retime(F, NT1, 'linear', 'EndValues', 'linear'), S, 'uniform', 0);
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Timetables 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!