简单来说就是二维数据插值下面是matlab给出的解释INTERP22-Dinterpolation(tablelookup).ZI=INTERP2(X,Y,Z,XI,YI)interpolatestofindZI,thevaluesoftheunderlying2-DfunctionZatthepointsinmatricesXIandYI.MatricesXandYspecifythepointsatwhichthedataZisgiven.XIcanbearowvector,inwhichcaseitspecifiesamatrixwithconstantcolumns.Similarly,YIcanbeacolumnvectoranditspecifiesamatrixwithconstantrows.ZI=INTERP2(Z,XI,YI)assumesX=1:NandY=1:Mwhere[M,N]=SIZE(Z).ZI=INTERP2(Z,NTIMES)expandsZbyinterleavinginterpolatesbetweeneveryelement,workingrecursivelyforNTIMES.INTERP2(Z)isthesameasINTERP2(Z,1).ZI=INTERP2(...,METHOD)specifiesalternatemethods.Thedefaultislinearinterpolation.Availablemethodsare:'nearest'-nearestneighborinterpolation'linear'-bilinearinterpolation'spline'-splineinterpolation'cubic'-bicubicinterpolationaslongasthedataisuniformlyspaced,otherwisethesameas'spline'ForfasterinterpolationwhenXandYareequallyspacedandmonotonic,usethesyntaxZI=INTERP2(...,*METHOD).ZI=INTERP2(...,METHOD,EXTRAPVAL)specificiesamethodandascalarvalueforZIoutsideofthedomaincreatedbyXandY.Thus,ZIwillequalEXTRAPVALforanyvalueofYIorXIwhichisnotspannedbyYorXrespectively.AmethodmustbespecifiedforEXTRAPVALtobeused,thedefaultmethodis'linear'.AlltheinterpolationmethodsrequirethatXandYbemonotonicandplaid(asiftheywerecreatedusingMESHGRID).Ifyouprovidetwomonotonicvectors,interp2changesthemtoaplaidinternally.XandYcanbenon-uniformlyspaced.Forexample,togenerateacoarseapproximationofPEAKSandinterpolateoverafinermesh:[x,y,z]=peaks(10);[xi,yi]=meshgrid(-3:.1:3,-3:.1:3);zi=interp2(x,y,z,xi,yi);mesh(xi,yi,zi)ClasssupportforinputsX,Y,Z,XI,YI:float:double,single