2d extrapolation to replace NaN in corners

Hi !
I'm trying to do 2d extrapolation for my table in matlab.
I have a matrix with 101x101 values and corresponding axes with 1x101 and 101x1 values.
Now my problem is the following:
The corners of the matrix are containing NaN values which I want to replace with extrapolated values of the given data.

 采纳的回答

One option is fillmissing.
There are also offerings on the File Exchange, e.g.,

3 个评论

Hi ! Thanks a lot for your reply !
I allready self programmed something which is just performing like, so at least I learned that I could have saved time...
Mfm = fillmissing(M, 'nearest')
Unfortunately this isn't exactly what I want, I'm looking for a kind of interpolation / extrapolation of the given data.
Argument "linear" and "spline" aren't working as expected, but linear is the closest to what I need.
Because of saturation the curve should become flatter without rising again.
Update: "Linear" with dim = 2 seems so solve my problem !
Glad to hear it, but since fillmissing worked, please Accept-click the answer.

请先登录,再进行评论。

更多回答(1 个)

The fillmissing function may do what you want.
Try something like this —
M = NaN(5);
M([3 (7:9) 11:15 (7:9)+10 23]) = randi(9, 1, 13)
M = 5×5
NaN NaN 4 NaN NaN NaN 6 6 2 NaN 2 6 1 6 4 NaN 5 9 4 NaN NaN NaN 2 NaN NaN
Mfm = fillmissing(M, 'nearest')
Mfm = 5×5
2 6 4 2 4 2 6 6 2 4 2 6 1 6 4 2 5 9 4 4 2 5 2 4 4
.

类别

帮助中心File Exchange 中查找有关 Get Started with Curve Fitting Toolbox 的更多信息

产品

版本

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by