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: 837
Default Multiplying matrices in VBA

Why are you reinventing the wheel? LINEST does this.
http://www.stfx.ca/people/bliengme/E...Polynomial.htm

Depending on where your data lives, you can use one of the following
approaches from VBA
http://www.google.com/groups?selm=VA...37cab0%40t8000
http://www.google.com/groups?selm=ue...GP10.phx.gb l

These approaches can be adapted to MMULT and MMINVERSE if you really
want to do it manually.

Jerry

Mark Schreiber wrote:

I am trying to write a VBA User-defined function to develop a


quadratic curve-fit formula. It can be done on the spreadsheet


itself by creating a 3x3 square array of {X, X^2, X^3 ...} terms, and


a 3x1 vector array of {Y, XY, X^2Y} terms, then using the spreadsheet


function {=MMULT(MINVERSE(X_SquareArray),XY_VectorArray)}. This will


yield the coefficients for a quadratic polynomial y=b0 + b1*x +


b2*x^2. However, I have a number of datasets containing (X,Y)


ordered pairs, and don't want to devote a lot of spreadsheet space to


creating these arrays. Instead, I want to do all the matrix


multiplication down to obtaining the coefficients within the


user-defined function. Then the final step will be to set the


function value equal to the polynomial equation, using an input value


for x. Does anyone know how to do this trick?


 
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
Comparing two matrices [email protected] Excel Discussion (Misc queries) 1 May 1st 07 02:20 PM
inverse matrices Chey Excel Discussion (Misc queries) 6 January 31st 07 12:14 AM
matrices Eiman Excel Discussion (Misc queries) 0 December 9th 05 11:01 PM
Combining certain matrices [email protected] Excel Discussion (Misc queries) 1 January 8th 05 12:06 AM
transpose matrices Sander Lablans Excel Programming 4 August 4th 03 04:20 PM


All times are GMT +1. The time now is 08:26 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"