retime different variable for different methods

6 visualizaciones (últimos 30 días)
alpedhuez
alpedhuez el 19 de Jun. de 2022
Comentada: Steven Lord el 21 de Jun. de 2022
Suppose I have a table like
Visitor Temperature
1/1/22
1/2/22
...
6/18/22
6/19/22
Then I want to calculate
  • monthly sum of visitors
  • monthly average of temperature
I see I can write to retime one for @sum and one for @mean. But is it possible to have one retime and have @sum for Visitor variable and @mean for Temperature variable?

Respuesta aceptada

Steven Lord
Steven Lord el 19 de Jun. de 2022
Looking at the documentation page for the retime function, the description of the method input argument states that it must be "specified as a character vector, string scalar, or function handle." It cannot be specified as a cell array of either character vectors or function handles or a string array, which is likely how it would need to be specified to use different methods for different data variables.
See the "Apply Multiple Methods to Timetable" example on that documentation page for a model you can use for your retime calls and how to reassemble the data into one timetable afterwards.
  2 comentarios
alpedhuez
alpedhuez el 20 de Jun. de 2022
Yes I read it before posting and "I see I can write to retime one for @sum and one for @mean. But is it possible to have one retime and have @sum for Visitor variable and @mean for Temperature variable?"
Steven Lord
Steven Lord el 21 de Jun. de 2022
No, you can't do that with one retime call.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Timetables en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2022a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by