How can I delete a specific row from a timetable?
15 次查看(过去 30 天)
显示 更早的评论
Hi!
Thank you for all the supports you guys always provide here. I have a question. I attached a timetable. It's a very simple timetable.mat file with only 15 rows.
What I want is to delete those rows that has the beginning hours, for example, 01:00, 04:00, 06:00, 08:00 etc. And I want to keep the only time rows that are in between, such as, 03:15, 08:12, 11:39.
Can anyone please help me with this issue? The .mat file is attached with the question.
0 个评论
采纳的回答
Star Strider
2023-1-30
Try something like this —
LD = load(websave('TimeTable','https://www.mathworks.com/matlabcentral/answers/uploaded_files/1278715/TimeTable.mat'));
Period = LD.Period
Period.TimeSeries = Period.TimeSeries + timeofday(datetime(Period.HourSeries, 'InputFormat','HH:mm'))
RowsToKeep = minute(Period.TimeSeries) ~= 0
PeriodEdited = Period(RowsToKeep,:)
.
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!