Bluebit Software
Bluebit Software Support Forum
 Home          Members     Calendar     Who's On

Welcome Guest ( Login | Register )
        



Use of MaXC30 in Excel Expand / Collapse
Message
Posted Monday, March 01, 2004 4:50 PM Post #6
 

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie
Hi,

I am having trouble with using the eigen method

I get an 'type mismatch (13)' error no matter how I try to using it. The
code below does not work and gives the error I have mentioned.

Sub genvalues(Sheet, FX, FY)
Set M = CreateObject("BluebitMatrix30.Matrix")
M.Size 3, 3

For X = 0 To 2
For Y = 0 To 2
M(X, Y) = Worksheets(Sheet).Cells(Y + FY, X + FX)
Next
Next

Set RoE = CreateObject("BluebitMatrix30.Matrix")
Set IoE = CreateObject("BluebitMatrix30.Matrix")
Set RoV = CreateObject("BluebitMatrix30.Matrix")
Set IoV = CreateObject("BluebitMatrix30.Matrix")

M.EigenC RoE, IoE, RoV, IoV
....
End Sub


I have also tried not declaring the variables.

Can you tell me what I am doing wrong.

Thanks in advance
Posted Monday, March 01, 2004 4:56 PM Post #161
 

Bluebit SupportBluebit SupportBluebit SupportBluebit SupportBluebit SupportBluebit SupportBluebit SupportBluebit Support
Hi

The reason for this 'type mismatch' error is that Eigen method expects to find as parameters Matrix object variables.

The variables that you are using (RoE, IoE, RoV, IoV) have not been declared as Matrix variables so they are Variants by default. Those variants contain references to Matrix objects.

A Variant variable containing a reference to a Matrix object is not the same as a Matrix variable.

To solve this problem please modify your code as follows:

Sub genvalues(Sheet, FX, FY)
Dim M As Matrix, RoE As Matrix, IoE As Matrix
Dim RoV As Matrix, IoV As Matrix

' CreateObject is fine but you can also use:
' Set M = New BluebitMatrix30.Matrix
' or
' Set M = New Matrix
Set M = CreateObject("BluebitMatrix30.Matrix")
M.Size 3, 3

For X = 0 To 2
For Y = 0 To 2
M(X, Y) = Worksheets(Sheet).Cells(Y + FY, X + FX)
Next
Next


Set RoE = CreateObject("BluebitMatrix30.Matrix")
Set IoE = CreateObject("BluebitMatrix30.Matrix")
Set RoV = CreateObject("BluebitMatrix30.Matrix")
Set IoV = CreateObject("BluebitMatrix30.Matrix")

M.EigenC RoE, IoE, RoV, IoV
....
End Sub




Trifon Triantafillidis

Lead Developer

Bluebit Software

« Prev Topic | Next Topic »


Reading This Topic Expand / Collapse
Active Users: 0 (0 guests, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: Trifon

Permissions Expand / Collapse

All times are GMT -5:00, Time now is 3:08am

Powered by InstantForum.NET v4.1.4 © 2012
Execution: 0.219. 10 queries. Compression Disabled.
.NET Matrix Library