Results 1 to 2 of 2

Thread: RESOLVED[Vector in vba]

Threaded View

  1. #1

    Thread Starter
    Addicted Member Fonty's Avatar
    Join Date
    May 2006
    Location
    New York
    Posts
    173

    Resolved RESOLVED[Vector in vba]

    Lets say I declare the following variables which are between 0 and 1.

    VB Code:
    1. Dim a As byte
    2. Dim b as byte
    3. Dim c As byte
    4. Dim d As byte
    5. '... etc
    In fact there are 37 variables.

    Then I have a list of 37 constants in some worksheet, and I put them into a vector called m.

    VB Code:
    1. Dim m() As Integer
    2. ReDim m(37)
    3. For i= 1 to 37
    4. m(i)= Cells(1,i).Value
    5. Next i

    My problem is to compute the following product:
    op=a*m1+b*m2+c*m3+...
    How can I use each of the elements of the vector m, in order to multiply them to an indiividual element (e.g. a or b or c, etc)?
    Last edited by Fonty; May 19th, 2006 at 10:07 AM.

Posting Permissions

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



Click Here to Expand Forum to Full Width