Closed Thread
Results 1 to 18 of 18

Inverse Matrix

  1. #1
    Registered User
    Join Date
    11-25-2008
    Location
    Poland
    Posts
    25

    Inverse Matrix

    Hello.

    Please Login or Register  to view this content.
    It is my code to put values from my Array to the excel Workbook
    User gives i and j.

    How to make a macro, which will make an Inverse Matrix of Mtrx(i,j) ??
    I have just tried with Recording Macro, but it does not work...
    Please save me and help me
    Last edited by adashiu; 12-02-2008 at 07:35 PM. Reason: mistake

  2. #2
    Forum Expert
    Join Date
    10-10-2008
    Location
    Northeast Pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    2,387
    adashiu,

    Please post a workbook with sample data on sheet1, and the "Inverse Matrix" on sheet "Inverse".

    Scroll down and see "Manage Attachments".

    Have a great day,
    Stan
    Have a great day,
    Stan

    Windows 10, Excel 2007, on a PC.

    If you are satisfied with the solution(s) provided, please mark your thread as Solved by clicking EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.

  3. #3
    Registered User
    Join Date
    11-25-2008
    Location
    Poland
    Posts
    25

    Unhappy

    It is a part of a program i need to make :


    In Matrix Form there is a code :
    Please Login or Register  to view this content.
    How to make an Inverse of Mtrx(i,j) and write it to the "Inverse" sheet?... Im on a verge of depression because of this program...

    An it is a part of Matrix2 Code:
    Please Login or Register  to view this content.
    I need to make a multiplication of Matrx and Mtrx2 ... Please help, Im on a verge of depression because of this program...
    Attached Files Attached Files
    Last edited by adashiu; 12-03-2008 at 04:11 AM.

  4. #4
    Registered User
    Join Date
    11-25-2008
    Location
    Poland
    Posts
    25
    It is my program here !
    Matrices.xls IT IS CORRECT. This up there is beoken, Sorry

  5. #5
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606
    A bit hard to follow, but try this. I think I've only amended the penultimate line. Please let me know if this cures your depression.
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    11-25-2008
    Location
    Poland
    Posts
    25
    Thank you very much. It cured me Do you know how to make multiplication of Mtrx and Mtrx2 ?? You are fantastic

  7. #7
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326
    Does the MMULT function help?

  8. #8
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606
    Excellent news. I think arthurbr has answered your second question.

  9. #9
    Registered User
    Join Date
    11-25-2008
    Location
    Poland
    Posts
    25
    It is a code which writes Mtrx and Mtrx2 to the excel sheet :

    Please Login or Register  to view this content.
    Could You write me a line like before which will multiply these two matrcies?
    Similiar to this one:
    Please Login or Register  to view this content.
    Please... Im trying to do this, but im too green for that

  10. #10
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606
    It's quite hard to follow what you're doing. Is this the relevant bit? aiMat1/2 don't appear to be defined.
    Please Login or Register  to view this content.

  11. #11
    Registered User
    Join Date
    11-25-2008
    Location
    Poland
    Posts
    25
    Hello!
    These what is written in attachments is not important, now It is my actual Multiplication function :

    Please Login or Register  to view this content.

    With Inverse you have written
    Please Login or Register  to view this content.
    And how to do it with multiplication?

  12. #12
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326
    For your information, XL has a MINVERSE and a MMULT function

  13. #13
    Registered User
    Join Date
    11-25-2008
    Location
    Poland
    Posts
    25
    Stephen has written me a code line today, which counts Inverse... I would really appreciate if he does it with multiplication.

  14. #14
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606
    It will be something like this:
    Please Login or Register  to view this content.
    - the top left cell where you want the result to go
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    but I don't where the matrices you want multiplying are so I can't be specific. It might help if you could add an example to your attachment.

  15. #15
    Registered User
    Join Date
    11-25-2008
    Location
    Poland
    Posts
    25
    Matrices.xls

    Here it is my almost done program... Multiplication is my last thing to do

    The multiplying code is in Matrix2 Form Code. If You could have a look, please. I have done everything, but it is out of my capacity ;/

    Look for :
    If Matrix.MultButton.Value = True Then
    Application.Sheets.Add
    Application.ActiveSheet.name = "Multiplication"

    For i = 1 To Columns
    For j = 1 To Columns1
    Mtrx2(i, j) = Matrix2.Controls("v" & i & "c" & j).Text
    Next
    Next
    End If

    For i = 1 To Columns
    For j = 1 To Columns1
    Sheets("Multiplication").Range("A1").Offset(i, j) = Mtrx(i, j)
    Sheets("Multiplication").Range("A24").Offset(i, j) = Mtrx2(i, j)
    Next
    Next


    Matrix2.Hide
    Matrix.Hide

    End If


    Thanks, Adam

  16. #16
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606
    I've added the last line below, which I think works:
    Please Login or Register  to view this content.

  17. #17
    Registered User
    Join Date
    11-25-2008
    Location
    Poland
    Posts
    25
    Stephen, Thank You very much for help and your time consumed on my task. Today I gave my work to the teacher Hope I will get A

  18. #18
    Registered User
    Join Date
    10-23-2010
    Location
    Mexico
    MS-Off Ver
    Excel 2003
    Posts
    1

    Re: Inverse Matrix

    Please help with my follow question , see the next attachment....
    Attached Files Attached Files

Closed Thread

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