Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6064859
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:19:34+00:00 2026-05-23T09:19:34+00:00

I am using the Matlab/Octave imresize() function which resamples a given 2D array. I

  • 0

I am using the Matlab/Octave imresize() function which resamples a given 2D array. I want to understand how a particular interpolation algorithm used in imresize works.

(I am using octave on windows)

e.g.

A =  1 2 
     3 4

is a 2D array. Then I use the command

b=imresize(a,2,'linear'); 

basically upsampling row and columns by 2.

The output is

1.0000   1.3333   1.6667   2.0000
1.6667   2.0000   2.3333   2.6667
2.3333   2.6667   3.0000   3.3333
3.0000   3.3333   3.6667   4.0000

I don’t understand how this linear interpolation is working. It is said to use bilinear interpolation, but how does it pad the data at boundaries and how does it get the output that it is getting?

Second example:
For

A = 

1   2   3   4
5   6   7   8
0   1   2   3
1   2   3   4

how does imresize(a,1.5,'linear') give the following output?

1.00000   1.60000   2.20000   2.80000   3.40000   4.00000
3.40000   4.00000   4.60000   5.20000   5.80000   6.40000
4.00000   4.60000   5.20000   5.80000   6.40000   7.00000
1.00000   1.60000   2.20000   2.80000   3.40000   4.00000
0.40000   1.00000   1.60000   2.20000   2.80000   3.40000
1.00000   1.60000   2.20000   2.80000   3.40000   4.00000
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T09:19:34+00:00Added an answer on May 23, 2026 at 9:19 am

    As you can see, in your example, each corner point is one of your original input values.

    The intermediate values are derived via linear interpolation in each direction. So for instance, to calculate b(3,2):

    • b(1,2) is 1/3 of the way between b(1,1) and b(1,4). So:

      b(1,2) = (1/3)*b(1,4) + (2/3)*b(1,1)
      
    • b(4,2) is 1/3 of the way between b(4,1) and b(4,4). So:

      b(4,2) = (1/3)*b(4,4) + (2/3)*b(4,1)
      
    • b(3,2) is 2/3 of the way between b(1,2) and b(4,2). So:

      b(3,2) = (2/3)*b(4,2) + (1/3)*b(1,2)
      
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm used to working in Matlab using its full GUI environment. Due to license
Using MATLAB , I have an array of values of size 8 rows x
I am trying to translate a function in a book into code, using MATLAB
While using MATLAB 2D filter funcion filter2(B,X) and convolution function conv(X,B,'') , I see
I'm using Matlab 7 and have a problem in creating a monoflop which shall
In my matlab m-file I am using some logic (string concat) to build variables
I'm using polar plots (POLAR(THETA,RHO)) in MATLAB. Is there an easy way to fix
I am using OdePkg in Octave to solve a system of stiff ODEs, e.g.
Folks, Matlab 2007b (7.5.0) has an avgpower function. See here : The avgpower method
I've built a Matlab/Simulink model that I'm using to simulate the performance of an

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.