Results 1 to 5 of 5

How to find intersectin of two arrays

Threaded View

  1. #1
    Registered User
    Join Date
    11-07-2008
    Location
    Weaverville, CA
    Posts
    2

    How to find intersectin of two arrays

    What's the best way to find the intersection of two polynomial arrays, preferably in a user defined function so that I don't have to use lots of cells on a worksheet? Specifically, I have two x,y arrays, one which slopes from bottom left to upper right, the other that slopes from upper left to bottom right. I thought I'd use the LINEST function to find the polynomial coefficients of each array (m1, m2, ..., mn), and iterate to find the "predicted" y value based on assumed x for each array until both y values are within some reasonable error.

    The second part of this problem is, I can't get teh LINEST function to work in a user defined formula in VB for a polynomial to find the polynomial coefficients (m1, m2, ...mn). I think I'm having a problem with the use of brackets, as shown below:
    Temp = Application.WorksheetFunction.LinEst(y, x^{1,2,3})
    m1 = Application.WorksheetFunction.Index(Temp,1,1)
    m2 = Application.WorksheetFunction.Index(Temp,1,2)
    m3 = Application.WorksheetFunction.Index(Temp,1,3)
    mn= Application.WorksheetFunction.Index(Temp,1,n)
    Or, should I be using a regression formula to find the intersection of these two arrays?
    Last edited by VBA Noob; 11-07-2008 at 01:47 PM. Reason: Added Code Tags. Amended Move to programming also

Thread Information

Users Browsing this Thread

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

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