Interpolation problem with NaN numbers
8 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I have emission matrix of 512 x 101 and for that i have corresponding X0 and Y0 value matrix. matrix x contains number varies from (-25 to 25) and along with NaN numbers same with matrix y which varies from (-25 to 25) and having NaN.
now i want to interpolate emission data using interp2 command but i could not perform interpolation. for this i have attached the matfile name inversion0.mat
please help me in this regard.
0 Kommentare
Antworten (1)
Guillaume
am 22 Aug. 2016
2 Kommentare
Guillaume
am 23 Aug. 2016
Having now looked at your mat file, you certainly are not going to be interpolating that with interp2 which requires the x and y to be gridded.
Possibly, this is what you want:
%build interpolant:
tokeep = ~(isnan(X0) | isnan(Y0));
interpolant = scatteredInterpolant(X0(tokeep), Y0(tokeep), Emission(tokeep))
%query interpolant at x = 5.5, y = 25:
interpolant(5.5, 25)
Siehe auch
Kategorien
Mehr zu Interpolation 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!