Summing Values in Matrix
Summing Values in Matrix
(OP)
Does anyone know how I can add all the values in a i,j matrix. I want my program to generate a matrix using the following:
i =: 1..n
j =: 1..m
Matrices can be created for numerous values of n and m. An example is shown below:
L(i,j) = i*j
Where i and j are the indices, not functions for L. This creates a create a n x m matrix which is what I want but I want my MathCAD program to sum all values in the Matrix L for various i and j values. For instance if n=2 and m=2,
L = [ 1 2:
2 4]
I want my value for the sum equal to 1 + 2 + 2 + 4 = 9.
Note I set my Array Origin to 1. Any help would be greatly appreciated.
i =: 1..n
j =: 1..m
Matrices can be created for numerous values of n and m. An example is shown below:
L(i,j) = i*j
Where i and j are the indices, not functions for L. This creates a create a n x m matrix which is what I want but I want my MathCAD program to sum all values in the Matrix L for various i and j values. For instance if n=2 and m=2,
L = [ 1 2:
2 4]
I want my value for the sum equal to 1 + 2 + 2 + 4 = 9.
Note I set my Array Origin to 1. Any help would be greatly appreciated.
RE: Summing Values in Matrix
TTFN
RE: Summing Values in Matrix
RE: Summing Values in Matrix
rows(L)*cols(L)*mean(L)
is quicker than using the summation operators. It is on my PC in ver 11.2a.
Jon