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.
0 个评论
采纳的回答
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 Center 和 File Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!