Consulting

Results 1 to 3 of 3

Thread: How to Create Function for Matrix Multiplication

  1. #1

    How to Create Function for Matrix Multiplication

    Hi,

    I have some problem with function of MMULT in excel.
    I want to do sample two matrix multiplication by MMULT function.
    X matrix at a given interval and k is a function that multiplies the matrix for the value of the number.


    Many thanks for your help.


    Example: Selected cells in the range A1 and C3, and Let k be the value of 3 (k=3).


    =MatrixMultiply(A1:C3;3) -->> will give result




    Function MatrixMultiply(X As Range, k As Integer) As Variant
    .
    .
    .
    End Function
    ‘---------------------------
    ‘Sample Use
    ‘-----------------------
    Sub Test()
    .
    .
    .
    End Sub

  2. #2
    Mac Moderator VBAX Guru mikerickson's Avatar
    Joined
    May 2007
    Location
    Davis CA
    Posts
    2,778
    My reply at your cross-post has a solution
    https://www.mrexcel.com/forum/excel-...plication.html

  3. #3
    Moderator VBAX Sage SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    7,814
    Location
    Sub test_MatrixMultiply()
    MatrixMultiply ActiveSheet.Range("A1:C3"), ActiveSheet.Range("E1")
    End Sub
    Sub MatrixMultiply(Multiplicand As Range, Multiplier As Range)
    Multiplier.Copy
    Multiplicand.PasteSpecial xlPasteValues, xlPasteSpecialOperationMultiply
    End Sub
    I expect the student to do their homework and find all the errrors I leeve in.


    Please take the time to read the Forum FAQ

Tags for this Thread

Posting Permissions

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