group excel data based on time and add a new matrix
Show older comments

need to group excel data based on time .example in column 5, 40189 . all 40189 data in matrix1 and then create second matrix to collect 40190 data . how can i make this?
Answers (1)
Peter Perkins
on 15 Mar 2018
OK, I'll take a guess: data collected in 2010, tagged with Excel serial day numbers?
Read the spreadsheet in using readtable. Convert what has become Var5 to a datetime as
t.Var5 = datetime(t.Var5,'ConvertFrom','excel')
Add meaningful variable names to the table. If you have R2016b or later, convert to a timetable using table2timetable. Use varfun with time as the grouping variable, or use findgroups/splitapply, to compute whatever you need to on each subset of your data.
You likely do not need to split the data up.
Categories
Find more on Spreadsheets in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!