Set tolerance for griddata
2 views (last 30 days)
Show older comments
Solmaz Kahourzade
on 11 Jun 2018
Commented: Solmaz Kahourzade
on 11 Jun 2018
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 Comments
Accepted Answer
KSSV
on 11 Jun 2018
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) ;
More Answers (0)
See Also
Categories
Find more on Creating and Concatenating Matrices in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!