retime different variable for different methods
2 ビュー (過去 30 日間)
古いコメントを表示
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?
0 件のコメント
採用された回答
Steven Lord
2022 年 6 月 19 日
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 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Timetables についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!