Matrix ANALYSIS

F

filo666

I'm trying to solve a system of equations, I have 9 unknowns and 10
equations; the solution of the equation exists depending upon the
coefficients of the equations; for example, If I don’t get the solution with
the first 9 equations, I can change one of the original equation with the
tenth equation and look if there is a solution, if not I change another
equation until the solution is found.

My problem is that I can not explain excel how to add two ranges with the
=mdeterm function; for example:

A B C
1 2 3 4
2 1 0 3

=mdeterm(a1:b2) has a solution
I can not jump the B column and still have a range; for instance, this
formula does not work: =mdeterm(a1:a2,c1:c2)
How can I explain excel or the function that it needs to consider the range
jumping whatever number of columns?
 
B

Bernard Liengme

Let the coefficients of your 10 equations be in A1:J9
The sub below copies the first nine columns to A12:I20
Then it displays the value of MDETERM for the range A12:I20
This is repeated 9 more times with the substitution of the columns 1 thru 9
in turn by column 10 (J1:J9)
In this way you can see which 9 equations to use for the solution

Sub what9()
Range("A1:I9").Copy Destination:=Range("A12")
mydeterm = WorksheetFunction.MDeterm(Range("A12:I20"))
MsgBox mydeterm
For k = 1 To 9
Range("A1:I9").Copy Destination:=Range("A12")
Range("J1:J9").Copy Destination:=Cells(12, k)
mydeterm = WorksheetFunction.MDeterm(Range("A12:I20"))
MsgBox mydeterm
Next k
End Sub

best wishes
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top