Set tolerance for griddata

2 Ansichten (letzte 30 Tage)
Solmaz Kahourzade
Solmaz Kahourzade am 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.

Akzeptierte Antwort

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

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Creating and Concatenating Matrices 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!

Translated by