How can I delete a specific row from a timetable?
15 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Ashfaq Ahmed
il 30 Gen 2023
Commentato: Star Strider
il 30 Gen 2023
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 Commenti
Risposta accettata
Star Strider
il 30 Gen 2023
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,:)
.
2 Commenti
Più risposte (0)
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!