Ignoring NaNs in Data

Hi,
I have a matrix of data I'm trying to fit a surface to, which contains a larger number of NaNs. When i use the 'sftool' tool, it says 'Ignoring NaNs in data' (which is exactly what I want) and works fine.
However, when I try to reproduce this, via the 'fit' function or the generated MATLAB code from sftool, it won't allow me as "XDATA, YDATA or WEIGHTS cannot have NaN values."
So my question is: how do I get the fit function to ingore the NaNs like it does automatically when using the graphical interface.
Many thanks for any help.

Respuestas (0)

Categorías

Preguntada:

el 10 de Ag. de 2012

Community Treasure Hunt

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

Start Hunting!

Translated by