Filter löschen
Filter löschen

How to: Retime a timetable without omitting NaNs

8 Ansichten (letzte 30 Tage)
Corymbiamaculata
Corymbiamaculata am 15 Okt. 2019
Kommentiert: Peter Perkins am 15 Apr. 2020
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 Kommentare
KAE
KAE am 8 Apr. 2020
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 am 15 Apr. 2020
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.

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Timetables finden Sie in Help Center und File Exchange

Produkte


Version

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by