Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

New to MATLAB?

How to do 2D array interpolation

Asked by Pranjal Pathak

Pranjal Pathak

on 26 May 2013

Hi, I have a 2d array of values of dimension 4x4, and I would like to do a bilinear interpolation upto a dimension of 1024x1024. I would be very grateful, if anyone helps me in this regard.

The 2d array is:

    A=[0.0169    0.5876    0.4689    1.0000;
       0.5989    0.6525    0.3475    0.3559;
       0.5706    0.6525    0.3814    0.3616;
         0       0.5537    0.4011    0.8644];

Thanking You!

0 Comments

Pranjal Pathak

Pranjal Pathak

Products

No products are associated with this question.

1 Answer

Answer by Matt J

Matt J

on 26 May 2013
 x=linspace(1,4,1024); 
 F=griddedInterpolant(A); 
 result=F({x,x});

2 Comments

Pranjal Pathak

Pranjal Pathak

on 26 May 2013

Thanks Matt for your reply, but this command did not run in my Matlab version R2008a showing an error as :Undefined function or variable 'griddedInterpolant'. Is there any command or way to do this?

Thanking You!

Matt J

Matt J

on 26 May 2013
 result = interp2(A,x(:),x);
Matt J

Matt J

Contact us