![]() ![]() By repeatedly squaring and multiplying the squares by the output value you can drastically reduce the number multiplications required. If you want to raise the matrix to a large power (like 1 billion), the above will leave you waiting for a long time. This simple function does not test for a square matrix (which you need if you are going to multiply a matrix by itself).Įd Ferrero I know this is an ancient post but there is a much better answer. ![]() Function PowerMatrix(rngInp As Range, lngPow As Long) As Variant Dim i As LongPowerMatrix = rngInp If lngPow > 1 Then For i = 2 To lngPow PowerMatrix = (rngInp, PowerMatrix) Next End If End Function
0 Comments
Leave a Reply. |