Azzera filtri
Azzera filtri

How to: Retime a timetable without omitting NaNs

8 visualizzazioni (ultimi 30 giorni)
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 Commenti
KAE
KAE il 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 il 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.

Accedi per commentare.

Risposte (0)

Categorie

Scopri di più su Timetables in Help Center e File Exchange

Prodotti


Release

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by