Posted 8 September 2017, 3:08 pm EST
Hello I'm trying to perform MInverse on a 3x3 matrix. I had been
doing this in Excel but having a hard time trying to do this with Spread
There is some example data from my project below. Within VBA I would pass an array of data and it would return an array of data. I have been looking around for an example in the documentation and on this forum but I can't find one.
I am able to get MInverse to calculate correctly within spread and reviewing the result with Index function but was hoping I could be shown an example of how it can be done within the code.
This is how I'm currently attempting to load into CalcEngine.Minverse function:
Dim spIndex As FarPoint.CalcEngine.IndexFunctionInfo
Dim spMInverse As FarPoint.CalcEngine.MInverseFunctionInfo
Dim oArgs(,) As Object
oArgs(0, 0) = 5186098731.6
oArgs(0, 1) = 727853662.52
oArgs(0, 2) = -587910789.75
oArgs(1, 0) = 727853662.52
oArgs(1, 1) = 2883789301.73
oArgs(1, 2) = -422415346.07
oArgs(2, 0) = -587910789.75
oArgs(2, 1) = -422415346.07
oArgs(2, 2) = 117239889.35
spMInverse.Evaluate(oArgs) ' It doesn't like a 2 dimensional array, this is where I am stuck if I make it one dimension not sure how it will know it is 3x3??
This link has an image showing how I was able to get it to work in Spread http://postimg.org/image/4ld0l745v/
The input values and the result within Excel
|The values for the 3x3 matrix|
|The Minverse result|
Thank you for your help