Set tolerance for griddata

3 vues (au cours des 30 derniers jours)
Solmaz Kahourzade
Solmaz Kahourzade le 11 Juin 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.

Réponse acceptée

KSSV
KSSV le 11 Juin 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) ;
  1 commentaire
Solmaz Kahourzade
Solmaz Kahourzade le 11 Juin 2018
Thank you so much KSSV. It worked perfectly.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Creating and Concatenating Matrices dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by