how can I interpolate?

1 ビュー (過去 30 日間)
jack nn
jack nn 2016 年 5 月 18 日
コメント済み: Walter Roberson 2016 年 5 月 20 日
hi all. I have some data and I want to interpolate z in this data. I used this code:
% year2012=xlsread('year2012');
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 件のコメント
jack nn
jack nn 2016 年 5 月 19 日
thanks dear Isakson. I just used 1:91 in my code.


回答 (1 件)

Andrei Bobrov
Andrei Bobrov 2016 年 5 月 18 日
F = scatteredInterpolant(X,Y,Z);
out = F(x,y);
  6 件のコメント
Walter Roberson
Walter Roberson 2016 年 5 月 20 日
Go ahead and create another Question.


Community Treasure Hunt

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

Start Hunting!

Translated by