+ Reply to Thread
Results 1 to 4 of 4

Interpolation of 2D Array

  1. #1
    Registered User
    Join Date
    01-31-2019
    Location
    Sweden
    MS-Off Ver
    365
    Posts
    2

    Post Interpolation of 2D Array

    Hello there!

    I am trying to figure out how to interpolate a 2D data array using VBA with the data being kept within of a macro.

    Below, the T (y) and C (x) is chosen by the user (two cells with the information) and the A_rho is the combined rho variables.

    VBA Data (dataset can be changed if needed, this is just how I set it up)
    Please Login or Register  to view this content.
    I am able to do this with Matlab, but not with a VBA function.

    Matlab code with an internal interp2 file looks something like this
    Please Login or Register  to view this content.
    Note: at sign after interpolated= is removed due to forum thinking it is a link.

    Example:
    A1 = T2 = 20
    A2 = C2 = 42
    A3 = output = 1.4492

    I can figure the interpolation out if the data is in the excel already, but when the data is inside the code, I am very unsure. Any suggestions would be great.

    Cheers!
    Last edited by svensvba; 02-05-2019 at 05:45 AM. Reason: SOLVED

  2. #2
    Forum Guru karedog's Avatar
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,971

    Re: Interpolation of 2D Array

    Maybe :
    Please Login or Register  to view this content.
    Formula on A3 :
    Please Login or Register  to view this content.
    If you need to change the data, just edit the hardcoded data in sub SetData() and then run this sub.
    Attached Files Attached Files
    1. I care dog
    2. I am a loop maniac
    3. Forum rules link : Click here
    3.33. Don't forget to mark the thread as solved, this is important

  3. #3
    Registered User
    Join Date
    01-31-2019
    Location
    Sweden
    MS-Off Ver
    365
    Posts
    2

    Talking Re: Interpolation of 2D Array

    Wonderful reply and was not expecting this detailed response!

    This is exactly what I needed and will just fix around it to fit my exact need.

    Thanks karedog!

  4. #4
    Forum Guru karedog's Avatar
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,971

    Re: Interpolation of 2D Array

    You are welcome svensvba, thanks for marking the thread as solved and rep.points.

    Regards

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Linear Interpolation of a Multidimensional Array
    By sperry2565 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-20-2013, 05:15 PM
  2. 2D interpolation
    By o0tintin0o in forum Excel General
    Replies: 1
    Last Post: 04-02-2012, 03:41 PM
  3. **3D Interpolation x,y,z -> f(x,y,z)**
    By kidongee in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-15-2011, 06:59 AM
  4. Interpolation
    By rehan0129 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-13-2010, 12:44 AM
  5. Expanding an array....Interpolation?
    By gannon_w in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-13-2008, 12:36 PM
  6. Replies: 0
    Last Post: 07-24-2008, 02:27 PM
  7. [SOLVED] interpolation in an array
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 12-12-2005, 11:45 PM
  8. [SOLVED] help with interpolation and limit of interpolation
    By uriel78 in forum Excel General
    Replies: 0
    Last Post: 02-18-2005, 10:06 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1