retime: apply different method for different columns

조회 수: 6 (최근 30일)
alpedhuez
alpedhuez 2020년 7월 7일
답변: Sai Sri Pathuri 2020년 7월 10일
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?
  댓글 수: 2
Steven Lord
Steven Lord 2020년 7월 8일
Isn't this related to one of your previous questions?
alpedhuez
alpedhuez 2020년 7월 8일
Yes. But I want to understand whether there is a simpler expression.

댓글을 달려면 로그인하십시오.

채택된 답변

Sai Sri Pathuri
Sai Sri Pathuri 2020년 7월 10일
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))];

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Timetables에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by