How to perform interpolation on a 2D array in MATLAB

前端 未结 4 1176
再見小時候
再見小時候 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

    Use the spline() command like this:

    % A contains N rows and 2 columns
    pp = spline(A(:,1), A(:,2));
    ppval(pp,3.44)
    
    ans =
    
        0.4454
    

提交回复
热议问题