필터 지우기
필터 지우기

How to: Retime a timetable without omitting NaNs

조회 수: 8 (최근 30일)
Corymbiamaculata
Corymbiamaculata 2019년 10월 15일
댓글: Peter Perkins 2020년 4월 15일
Hi,
I'm trying to use the retime function on a 488 x 12 x 4 timetable, and calculate monthly sums from 488 daily values. The problem is, there are lots of missing values (NaNs) in my dataset, and since retime's 'sum' method omits NaNs, in months with lots of missing data, I receive falsly low sums. I tried using @sum, but I'm getting an error:
Unable to concatenate incompatible values returned by the function 'sum' when applied to groups in the variable 'Var1':
Dimensions of arrays being concatenated are not consistent.
Any help will be appreciated!
  댓글 수: 3
KAE
KAE 2020년 4월 8일
I am getting this error too, perhaps due to irregularly sampled data so I don't have data in every bin. This is the only mention of the error I've found on the web. If you have figured it out, please post.
Peter Perkins
Peter Perkins 2020년 4월 15일
KAE, if you are using @sum, the problem is that the sum function returns an empty for empty input, and that can't be concatenated with the scalar value coming from the non-empty bins. That's why retime has it's own local version of sum, which you get by passing 'sum', not @sum. If you are doing something else, you need to give a short example of your data and what command you are using.

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

답변 (0개)

카테고리

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

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by