Set tolerance for griddata

2 次查看(过去 30 天)
Dear Sir/Madam,
In the Loss.mat, I have Fd and Fq matrices with 256*256 dimension as inputs and Pfer_c, Pfer_h, Pfes_c, Pfes_h, Ppm as the output of Fq and Fq. I want to obtain the value of Pfer_c, Pfer_h, Pfes_c, Pfes_h, Ppm for Fd_sat and Fq-sat (the values in LOSS_sat.mat) and I used griddata as following:
Pfer_c_sat = griddata(Fd, Fq, Pfer_c, Fd_sat, Fq_sat);
Pfer_h_sat = griddata(Fd, Fq, Pfer_h, Fd_sat, Fq_sat);
Pfes_c_sat = griddata(Fd, Fq, Pfes_c, Fd_sat, Fq_sat);
Pfes_h_sat = griddata(Fd, Fq, Pfes_h, Fd_sat, Fq_sat);
Ppm_sat = griddata(Fd, Fq, Ppm, Fd_sat, Fq_sat);
But the problem is for some values the results are “NaN” where makes the rest of my program unsolvable as they are input of a large program. Is there any way that I can estimate an integer values with the minimum error to avoid "NaN"?
I appreciate your help.

采纳的回答

KSSV
KSSV 2018-6-11
griddata will give you NaN's if the interpolating data lies outside the main data. YOu may have a look on scatteredInterpolant
load Loss.mat ;
load LOSS_sat.mat ;
% Pfer_c_sat = griddata(Fd, Fq, Pfer_c, Fd_sat, Fq_sat,'cubic');
F = scatteredInterpolant(Fd(:),Fq(:),Pfer_c(:)) ;
Pfer_c_sat = F(Fd_sat,Fq_sat) ;

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by