Is there a VBA add-in for matrix operations?

tuncalik

New Member
Joined
May 19, 2012
Messages
11
Hi all

Is there an extensive add-in for VBA/excel for matrix and vector operations?

In other words, an add-in with a selection of matlab or R functions?

Regards
Tunc
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.

hiker95

Well-known Member
Joined
Apr 8, 2009
Messages
17,649
tuncalik,

Welcome to the MrExcel forum.

There is a lot of information out there if you do a web search for excel vba for matrix and vector operations add-in with a selection of matlab or R functions
 

pgc01

MrExcel MVP
Joined
Apr 25, 2006
Messages
19,884
Hi Tunc
Welcome to the board

The matrix operations functions available in the worksheet can also be used in in vba. Do you need some special function? Maybe if you give some examples we can determine what is availble by default that serves your purposes and what's missing.
 

tuncalik

New Member
Joined
May 19, 2012
Messages
11
Apart from matrix functions like matrix multiplication, matrix inverse and transpose that are available to VBA as worksheet functions, I mean other matrix and set functions like:


  • matrix create; like ones, zeros, rand in matlab
  • matrix append; append matrix A to matrix B, either vertically or horizontally, like [A; B] or [A B] in matlab
  • matrix partitioning; like A(rowindices, colindices) in matlab
  • unique; unique elements of matrices or vectors
  • set intersection, difference, union ...
  • matrix/vector aggregations with functions like max, min, average, median

and so on. There are more than 50 such matrix, vector or set operations that are needed to write useful high level functions based on these elementary matrix/vector/set functions.

Regards
Tunc
 

pgc01

MrExcel MVP
Joined
Apr 25, 2006
Messages
19,884

ADVERTISEMENT

Hi Tunc

You are right, an add-in for matrix operations will make your life easier.
I'm sorry i cannot help you with a reference.


I hope you'll get an answer here, but if you find the add-in outside of this board, we'd be thankful if you'd post it here for future reference.


Remarks:


If you know vba you could also implement these functions yourself.


Looking at the operations you mentioned, some observations:

  • matrix/vector aggregations with functions like max, min, average, median
  • matrix partitioning; like A(rowindices, colindices) in matlab

These ones, together with:

  • multiplication
  • inversion
  • transposition
  • determinant
are directly available in vba


  • matrix create; like ones, zeros, rand in matlab
  • matrix append; append matrix A to matrix B, either vertically or horizontally, like [A; B] or [A B] in matlab
  • unique; unique elements of vectors

These are directly implemented using an auxilliary worksheet.

They can also easily be implemented as vba functions.




  • unique; unique elements of matrices or vectors
  • set intersection, difference, union ...


For these ones you'd have to write functions, that seem, however, simple enough.

Hope this helps.
 
Last edited:

tuncalik

New Member
Joined
May 19, 2012
Messages
11
Thank you for the information.

If I can't find such an add-in I will try to write it myself and let you know where to find it.

Regards
Tunc
 

Watch MrExcel Video

Forum statistics

Threads
1,132,670
Messages
5,654,653
Members
418,146
Latest member
Shnn028

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top