How can I delete a specific row from a timetable?
15 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Ashfaq Ahmed
le 30 Jan 2023
Commenté : Star Strider
le 30 Jan 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 commentaires
Réponse acceptée
Star Strider
le 30 Jan 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 commentaires
Plus de réponses (0)
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!