How to perform interpolation on a 2D array in MATLAB

前端 未结 4 1173
再見小時候
再見小時候 2020-12-04 02:01

How can I make a function of 2 variables and given a 2D array, it would return an interpolated value?

I have N x M array A. I need to inter

4条回答
  •  死守一世寂寞
    2020-12-04 02:26

    Have you seen the interp2 function?

    From MatLab documentation:

    ZI = interp2(X,Y,Z,XI,YI) returns matrix ZI containing elements corresponding to the elements of XI and YI and determined by interpolation within the two-dimensional function specified by matrices X, Y, and Z. X and Y must be monotonic, and have the same format ("plaid") as if they were produced by meshgrid. Matrices X and Y specify the points at which the data Z is given. Out of range values are returned as NaNs.

提交回复
热议问题