Separate all data from table by date
显示 更早的评论
Hi everyone!
I need to separate data in a table based on their dates. I cannot seem to figure out the code for this. I have found several options such as datenum and timetable. The datenum option gives me an error because the dates are not a string and datestr does not function either. The dates are displayed in the following format : DD/MM/YYYY. I have also tried converting the table to a structure but this just displays the date as: 1x1 datetime
2 个评论
Ameer Hamza
2018-5-1
Can you show an example of your table content, or better yet if you could share a sample mat file, which could contain the table data.
Debbie Oomen
2018-5-1
采纳的回答
更多回答(1 个)
Peter Perkins
2018-5-2
0 个投票
Debbie, Ameer's solution answers your question, but you should ask yourself why you want to split your data up. There are lots of things you can do by applying functions to groups of data while they are still within a table. In fact, findgroups/splitapply is one of the ways to do that.
Very often, you are better off leaving the data all in one container.
2 个评论
Debbie Oomen
2018-5-4
Peter Perkins
2018-5-14
I don't know what you mean by "get". If your goal is to split up the data, then you should do that, and Ameer's sol'n works. But I am suggesting that your goal is probably more like "find the mean temperature for each day", and you don't need to split up your data to do that.
类别
在 帮助中心 和 File Exchange 中查找有关 Data Type Conversion 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!