About interpolation of two-dimensional matrix question

조회 수: 1 (최근 30일)
min wong
min wong 2016년 12월 12일
편집: Walter Roberson 2016년 12월 13일
My matrix
A=[12 3 65,2 3 6,68 15 40,66 98 12]
A is 3*4
x=[19 20 21]
x is 1*3
y=[118 119 120 121]
y is 1*4
zz=interp2(x,y,A,xlat,xlon,'cubic'); xlat=12*21 ,xlon=12*21
but it shows error
Error using griddedInterpolant
The grid vectors do not define a grid of points that match the given values.
Error in interp2>makegriddedinterp (line 228)
F = griddedInterpolant(varargin{:});
Error in interp2 (line 128)
F = makegriddedinterp({X, Y}, V, method,extrap);
How can fix it?
thanks

채택된 답변

KSSV
KSSV 2016년 12월 13일
Try this....I think your A is not a matrix, it is a array, so error popped out.
clc; clear all ;
A = [12 3 65 ; 2 3 6 ;68 15 40 ;66 98 12] ;
x=[19 20 21];
y=[118 119 120 121] ;
xlat=12*21 ;xlon=12*21 ;
zz=interp2(x,y,A,xlat,xlon,'cubic');

추가 답변 (0개)

카테고리

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