Skip to main content
1-Visitor
February 25, 2016
Question

sum of array element

  • February 25, 2016
  • 9 replies
  • 4118 views

I am trying to sum of array elements. can someone help me to do this.

the attached picture is extracted from vba.

vba_function.jpg

9 replies

23-Emerald V
February 25, 2016

Mounir AL SOUFI wrote:

I am trying to sum of array elements. can someone help me to do this.

the attached picture is extracted from vba.

vba_function.jpg

Do you mean something like this?

Stuart

malsoufi1-VisitorAuthor
1-Visitor
February 25, 2016

Yes,but the problem that mathcad gove me error becuase it can't recognize matB when adding to mat c

23-Emerald V
February 25, 2016

Mounir AL SOUFI wrote:

Yes,but the problem that mathcad gove me error becuase it can't recognize matB when adding to mat c

Did you run the attached worksheet?  I've just run it again for various values of matrix size and it seems to work on my M15.

I notice that in your original post, you give the variable names as MatA, MatB & MatC, whereas you mention matB & matC above - Mathcad variable names are case sensitive, so you need to ensure that all variables are spelled consistently.  You also need to have defined all of the variables before you can use them.

Stuart

malsoufi1-VisitorAuthor
1-Visitor
February 25, 2016

Yes,but the problem that mathcad gove me error becuase it can't recognize matB when adding to mat c

23-Emerald I
February 25, 2016

I'm not sure how this code makes any sense.

But it works if all three matrices already exist.

malsoufi1-VisitorAuthor
1-Visitor
February 25, 2016

CAN YOU PLEASE SEE THIS CODE?@