How replace NaN's in a 3d field with the nearest value in the same column?
Ältere Kommentare anzeigen
I have a 3d (z,x,y) matrix and trying to fill NaN's in the each grid point in xy directions with the nearest value correspond to the previous layer (level).
Any help and information will be helpful. Thank you
2 Kommentare
madhan ravi
am 29 Mär. 2019
Can you illustrate with a short example?
Farshid Daryabor
am 29 Mär. 2019
Akzeptierte Antwort
Weitere Antworten (3)
Guillaume
am 29 Mär. 2019
fillmissing(your3darray, 'previous', 3) %fill nans with previous element along 3rd dimension
Possibly, with an optional 'EndValues', 'next' if you want to fill NaNs on the 1st layer with the next non-Nan value.
3 Kommentare
Farshid Daryabor
am 29 Mär. 2019
Farshid Daryabor
am 29 Mär. 2019
Guillaume
am 29 Mär. 2019
fillmissing requires R2016b or later. There is a field up there in the right corner of the page where you can enter which release you're actually using so we don't have to guess which functions may or may not be available to you.
Farshid Daryabor
am 3 Apr. 2019
0 Stimmen
Kategorien
Mehr zu Oceanography and Hydrology finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!