Search: | |||||

| ||||

Home » Forum » MS Office | RSS Feeds |

I ran the following, but the system gave me err "unable to get the Minverse

property of the worksheet function class". Anyone know what happened with that?

Sub Solutions()

q = Range("e12").Value

'define array temprate

Dim temprate() As Double

ReDim temprate(q, q)

For k = 0 To q - 1

For h = 0 To q - 1

temprate(k, h) = Cells(13 + k, 27 + q + h).Value

Next h

Next k

'Define array extrate

Dim Extrate() As Double

ReDim Extrate(q)

For k = 0 To q - 1

Extrate(k) = Cells(12 + k + 1, 27 + 2 * q).Value

Next k

'calculation

Dim results() As Double

ReDim results(q) As Double

For k = 0 To q - 1

results(k) =

Application.WorksheetFunction.MMult(Application.WorksheetFunction.MInverse(tempr\

ate()), Extrate)

Next k

End Sub

I'd like to bet that it's a non invertable matrix because, for example

if E12 contains the value 3, the matrix 'temprate' you're trying to

invert is 4 x 4 with zeroes all along the bottom and right hand side.

(Changing the bottom right member from 0 to 1 changed the error to

'Type mismatch', and worked on the sheet too.)

Try setting

Option Base 1

or ReDim temprate(q-1,q-1)

(along with the other arrays)

I didn't solve the type mismatch though, but you should be one step

further..

Also I ran into 'Unable to get the MMult property..' which I suspect

is solvable by

Application.WorksheetFunction.Transpose(Extrate)

instead of

Extrate

in the bothersome line.

because MMULT requires that 'the number of columns in array1 must be

the same as the number of rows in array2', and I *think* that vba

sees array2 as a single row horizontal array.

THEN I get the type mismatch again...

Running out of time now, one shot in the dark though; does this need

to be a loop? Would

results() = Application.Worksh....

work rather than

results(k) = Application.Worksh...

?

Didn't find what you were looking for?
Find more on About array matrix function
Or get search suggestion and latest updates.

Related Topics:

- About the Matrix size when use minverse function
- function that returns a String Array
- Array to array direct transfer in VB
- Array of Arrays
- Wait function and Invisible function
- Wait function and Invisible function
- PRINTING DATA IN MATRIX FORMAT
- Spearman Rank Correlation Matrix
- Strassen`s Matrix Multiplication algorithm
- matrix
- read a matrix of size 5x5,
- sparse matrix and linked lists
- how to print a matrix into File.
- Matrix and pattern programs in PHP
- matrix operations
- Iteration to Solve Ax=b With Input Matrix
- parallel matrix multiplication using multi-threading
- matrix
- Sparse Matrix Multiplication
- Average of numbers ; matrix
- matrix
- inverse of matrix.
- quantization matrix in JPEG codec
- Web Matrix & MS Access
- Design Pattern matrix