troubleshooting Question

Loop with matrices. Please help me!

Avatar of Hamood Hamood
Hamood Hamood asked on
VBAMicrosoft Excel
16 Comments1 Solution147 ViewsLast Modified:
Hello everyone.
Please I really need help.
I have a matrix that I want to square (multiplying it by itself).
and then I'm gonna add the value of each row of this matrix, and then add the value of this column and divide each value by the total.
Look at this picture and you will understand what I mean.
Weights.pngI need a code to repeat this process until the difference in the weight is < 0.01 (probably using loops).

Im using this code to square the matrices:
  Dim xArray As Variant, zArray As Variant
    Dim Fn As Object
    Set Fn = Application.WorksheetFunction
    xArray = Range("g11:j14").Value
    zArray = Fn.MMult(xArray, xArray)
     
    ActiveCell.Resize(4, 4).Value = zArray
  
Please help me!
and thanks in advance!
ASKER CERTIFIED SOLUTION
aikimark
Get vaccinated; Social distance; Wear a mask
Join our community to see this answer!
Unlock 1 Answer and 16 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 16 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros