MATLAB Answers

retime: apply different method for different columns

5 views (last 30 days)
I have a timetable with column 2 temperature and column 3 rainfall. I want to apply mean for column 2 and variance for column 3. Can one this be done with one retime function application?


alpedhuez on 8 Jul 2020
Yes. But I want to understand whether there is a simpler expression.

Sign in to comment.

Accepted Answer

Sai Sri Pathuri
Sai Sri Pathuri on 10 Jul 2020
It is not currently possible to apply different methods for different columns using a single retime function. You may try this:
outputTable = [retime(inputTable(:,2),'hourly','mean'), retime(inputTable(:,3),'hourly', @(x) var(x))];


Sign in to comment.

More Answers (0)


Community Treasure Hunt

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

Start Hunting!

Translated by