Removing NaN's and interpolating missing data

3 Ansichten (letzte 30 Tage)
Steve
Steve am 13 Jan. 2012
Hi all
I have a small problem with some data I'm trying to analyse.
I have some spreadsheet data which, in excel looks like this: (Google docs spreadsheet).
When I load this into MATLAB, it replaces the blanks with NaNs
What I need to do is remove the NaNs and replace them with values interpolated or extrapolated from the values around them, so that I can produce a surface plot using countourf. The first row and first column are the axes - they are horizontal and vertical positions respectively.
I'm a relative beginner to MATLAB, so although I've found some previous posts about how to replace NaNs and interpolate, I'm having some difficulty adapting those solutions to my specific problem.
Any help greatly appreciated.
Thanks Steve

Antworten (2)

Titus Edelhofer
Titus Edelhofer am 13 Jan. 2012
Hi,
a good starting point could be the File Exchange, e.g. this submission.
Titus

Grzegorz Knor
Grzegorz Knor am 13 Jan. 2012
  1 Kommentar
Steve
Steve am 13 Jan. 2012
Hi thanks, that seems to be what I need, but I'm a little unsure about how to use it - excuse my ignorance, I'm just unfamiliar with the intricacies of how MATLAB works.
Do I need to modify the inpaint_nans.m code with the names of my own workspace variables or is there a more general way to use this? Having to edit the code each time would be painstaking (I have lots of these).
Thanks for any help
Steve

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Large Files and Big Data finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by