LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 130
Default Matrix manipulation in vba code

Hello,
Let me try posting this again. I am trying to do some simple matrix
manipulation in vba. What I want to do is take a 4x4 matrix, invert
it, multiply a 4x1 column vector by the inverted matrix, and then put
the result into a column vector. I do not want to use ranges for the
inputs. I will put the matrix values into the matrix manually.

A is 4x4 matrix
B is 4x1 column
C is 4x1 column

Dim A(1 To 4, 1 To 4) As Double
Dim B(1 To 4) As Double
Dim C()

Here is how the matrices are established. The variables come from
worksheet cells (not shown)
A(1, 1) = x1 ^ 3
A(2, 1) = x2 ^ 3
A(3, 1) = 3 * x1 ^ 2
A(4, 1) = 3 * x2 ^ 2

A(1, 2) = x1 ^ 2
A(2, 2) = x2 ^ 2
A(3, 2) = x1 * 2
A(4, 2) = x2 * 2

A(1, 3) = x1
A(2, 3) = x2
A(3, 3) = 1
A(4, 3) = 1

A(1, 4) = 1
A(2, 4) = 1
A(3, 4) = 0
A(4, 4) = 0

B(1) = y1
B(2) = y2
B(3) = m1
B(4) = m2

What I want to do is invert A, then multiply B by A inverted, and put
the
results in C.

Here is my code:
C=MInverse(A)
C=MMult(C,B)

The code stops at the MMult(C,B) line, stating "Unable to get the
MMult property of the worksheetfunction class."

This seems to be a simple problem. Can anyone help me with this. An
example would be great.
thanks,
Andy
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
For better Performance in VBA for Excel - Strings manipulation OR Objects manipulation vmegha Excel Programming 2 December 19th 05 12:14 AM
Generating Code in Excel / Macro Recorder Manipulation [email protected] Excel Programming 2 August 18th 05 03:31 PM
Code for Access file manipulation from Excel Tom Urtis Excel Programming 0 July 21st 05 08:31 AM
VBA code manipulation cells Craig[_21_] Excel Programming 2 April 10th 05 10:06 AM
Halting code for worksheet manipulation? What-a-Tool[_2_] Excel Programming 2 November 5th 04 12:09 AM


All times are GMT +1. The time now is 08:05 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"