how can I interpolate?

1 Ansicht (letzte 30 Tage)
jack nn
jack nn am 18 Mai 2016
Kommentiert: Walter Roberson am 20 Mai 2016
hi all. I have some data and I want to interpolate z in this data. I used this code:
% year2012=xlsread('year2012');
year2012=double(year2012);
X=year2012(1:91,1);
Y=year2012(1:91,2);
Z=year2012(1:91,3);
x=year2012(1:91,4);
y=year2012(1:91,5);
z = interp2(X,Y,Z,x,y);
but I have this error :
% Error using griddedInterpolant
The coordinates of the input points must be finite values; Inf and NaN are not permitted.
Error in interp2>makegriddedinterp (line 228)
F = griddedInterpolant(varargin{:});
Error in interp2 (line 128)
F = makegriddedinterp({X, Y}, V, method,extrap);
Error in new (line 19)
z = interp2(X,Y,Z,x,y,'nearest');code
I attached my data and I think my data is true. can you please guide me?
  2 Kommentare
per isakson
per isakson am 18 Mai 2016
Hint:
jack nn
jack nn am 19 Mai 2016
thanks dear Isakson. I just used 1:91 in my code.

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Andrei Bobrov
Andrei Bobrov am 18 Mai 2016
F = scatteredInterpolant(X,Y,Z);
out = F(x,y);
  6 Kommentare
jack nn
jack nn am 20 Mai 2016
thanks, dear Walter Roberson. Can I ask an other question?
Walter Roberson
Walter Roberson am 20 Mai 2016
Go ahead and create another Question.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Interpolation 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