help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

fillmissing


From: Claude Marinier
Subject: fillmissing
Date: Wed, 10 Jun 2020 21:37:23 -0400

AllĂ´,

While taking an online MATLAB course and working on an exercise, I needed to use the fillmissing function. It is not included in the Octave version installed on Ubuntu 18.04 : GNU Octave, version 4.2.2

I searched for it or a replacement and found nothing useful. There seems to be something on the Math Exchange, but we are not allowed to use those. :-(

I created a quick MEX file to do this. The function takes a vector and replaces all NaN values with an interpolated value (linear). The code seems to work for the test cases I created.

Three things.

1) In the process, I found that line 83 in mex.h has a typo. I changed
#define mexGetNaN mxGetNan
to
#define mexGetNaN mxGetNaN
This fixed a compilation error.

2) Should there be functions equivalent to mexIsNaN and mexGetNaN for NA (Not Available)? Those would make a good addition to fillmissing; it seems like the expected use of NA - missing values.

3) Is there interest in this function? I can provide the C code and the test script.

Merci.

--
ClaudeM

reply via email to

[Prev in Thread] Current Thread [Next in Thread]