필터 지우기
필터 지우기

how can I interpolate?

조회 수: 3 (최근 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');
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
per isakson
per isakson 2016년 5월 18일
Hint:
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
jack nn
jack nn 2016년 5월 20일
thanks, dear Walter Roberson. Can I ask an other question?
Walter Roberson
Walter Roberson 2016년 5월 20일
Go ahead and create another Question.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Interpolation에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by