how to select range of dates
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
rohail khan
el 11 de Abr. de 2018
Comentada: Peter Perkins
el 13 de Abr. de 2018
I have stock data of 10 years with two columns.One is the stocks which is numeric and the other is dates which are in datetime format.I converted datetime to Numeric also. I want to calculate mean for each year using mean(stock) formula. But I dont know how can I select the data for each year separately? The days are also not continuous as there are holiday gaps How can I get the range of data for one year e.g like from jan 1 ,2007 to dec 31 2007 and then get its mean
0 comentarios
Respuesta aceptada
per isakson
el 11 de Abr. de 2018
Editada: per isakson
el 11 de Abr. de 2018
2 comentarios
Peter Perkins
el 13 de Abr. de 2018
There are any number of ways to do this. accumarray is old school. full(sparse(...)) would have been even older school. More beginner-friendly ways include findgroups/splitapply, and varfun with a grouping variable. And in R2018a, groupsummary.
Más respuestas (0)
Ver también
Categorías
Más información sobre Dates and Time en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!