Calling all Racers for the Alteryx Grand Prix! It's time to rev your engines and race to the stage at Inspire! Sign up here.
alteryx Community

# Alteryx Designer Discussions

SOLVED

## Matrix multiplication of symmetric matrices

5 - Atom

Hi everyone,

I'm trying to multiply a symmetric matrix of a predefined format (14x14) with another symmetric matrix of the same format.

The easiest case to show here would be to multiply the matrix with itself.

I know, the most convenient solution might be the matrix multiplication in e.g. python, but given that the python tool or other embedded code is not an option, does anyone have a good solution for that?

I added a sample matrix below, but you could just take any matrix there is.

7 REPLIES 7
17 - Castor

Hey @JohannesR,

Currently its not a feature but there is an idea/feature request in the community if you want to support it Support Basic Linear Algebra (Vectors and Matrices... - Alteryx Community. To achieve this you'll need to create an iterative or batch macro to loop through each column/row, couldn't find anyone on the gallery who has done this yet.

17 - Castor

Think I've misinterpreted the question (I took it as A1xA1, A2xA2 etc) so apologies if that's incorrect but here's the solution in case it helps:

5 - Atom

@DataNath Unfortunately, that's just not the correct result of the multiplication.

I would need the result as follows: Cell 1,1 = (A1,1 * A1,1)+(A1,2 * A2,1)+(A1,3 * A3,1)+...

The attached matrix is the result I'm actually looking for...

Alteryx Community Team

I've made a standard macro that seems to do the trick. If you test it out and it works I'll clean it up and post it on the Gallery.

[Brushed up on the mechanics here and tested it here.]

5 - Atom

I'm genuinely impressed by the solution. Works exactly as wished and when compared to python I only get differences from the 16th decimal point onwards which might be due to the floating point exception handled differently in python and in alteryx itself (I guess... Link to FPE ).

But I checked it against the Python solution and attached the workflow.