Skip to main content
1-Visitor
Apr 28, 2018 12:39 AM UTC
Solved

Sum of array elements

Hello good people

 

Capturar.PNG
Why mathcad says that v isn't a vector?

terryhendicott
21-Topaz II
Apr 28, 2018 3:06 AM UTC

Hi

Sorry forgot to say you need to define i as well.

Capture.JPG

5 replies

terryhendicott
21-Topaz II
Apr 28, 2018 2:31 AM UTC

Hi,

 

"v" needs to be a column vector for the index to work.  To index into a row vector the index needs to be "0,i" or "1,i" depending how ORIGIN is set.

Translate
terryhendicott
21-Topaz II
Apr 28, 2018 3:06 AM UTC

Hi

Sorry forgot to say you need to define i as well.

Capture.JPG

Translate
1-Visitor
Apr 28, 2018 4:10 PM UTC

That's it. Vectors are still matrices after all. To me it was natural write V(i) instead of V(0,i) , but I got it now. Maybe this can be a suggestion for future updates, just to clean up some notation.
Thanks for the help!

Translate
Werner_E
25-Diamond I
Apr 28, 2018 10:22 AM UTC

Not sure if you know that you don't need to fill the place holders for the sum if you want to sum up all elements. This will work for a column- and a row-vector alike.

If you really just want to sum a specific range of elements I would prefer the method Terry had already shown. Just for fun here are a few more you could use as well

B.png

Translate
1-Visitor
Apr 28, 2018 4:08 PM UTC

Thanks for the tips, it will be helpful!

Translate