Skip to main content
14-Alexandrite
May 20, 2022
Solved

Quickest way of summing all the number in a matrix in mcad15?

  • May 20, 2022
  • 2 replies
  • 1590 views

To all

 

What is the quickest way summing all the data in matrix in mcad 15?

I have a matrix of N columns

I want to sum all the number in the following colums

1&2

3&4

5&6

Etc

There are Nrow

ultimatly the number of columns will be “dynamic” but will always be a multiple of 6

Best answer by StuartBruff

@JXBWk wrote:

To all

 

What is the quickest way summing all the data in matrix in mcad 15?

I have a matrix of N columns

I want to sum all the number in the following colums

1&2

3&4

5&6

Etc

There are Nrow

ultimatly the number of columns will be “dynamic” but will always be a multiple of 6


Do you mean something like shown below?

 

2022 05 20 a.png

 

It should work for any matrix with an even number of columns.  The above is written in Prime 7, but the M15 equivalents should work.

 

Stuart

2 replies

23-Emerald V
May 20, 2022

@JXBWk wrote:

To all

 

What is the quickest way summing all the data in matrix in mcad 15?

I have a matrix of N columns

I want to sum all the number in the following colums

1&2

3&4

5&6

Etc

There are Nrow

ultimatly the number of columns will be “dynamic” but will always be a multiple of 6


Do you mean something like shown below?

 

2022 05 20 a.png

 

It should work for any matrix with an even number of columns.  The above is written in Prime 7, but the M15 equivalents should work.

 

Stuart

23-Emerald IV
May 20, 2022

Slightly different implementation that is ORIGIN independent:

LucMeekes_0-1653053942229.png

Success!
Luc

JXBWk14-AlexandriteAuthor
14-Alexandrite
May 21, 2022

Thanks @StuartBruff and @LucMeekes for the suggestions. It works but I realised that there is a slight difference to what I actually needed (I just need to work on a transposed matrix !)