Help with Summing the elements in an array

  • Follow


I have a 145x1 size matrix and I'm trying to sum all of those elements within the matrix. An example would be a matrix like [ 1 2 3 4] would equal 10 because 4+3+2+1=10. 

I've searched a while and any help would be great.
0
Reply Lee 9/25/2010 9:12:04 PM

On Sat, 25 Sep 2010 21:12:04 +0000 (UTC), "Lee "
<lsouthwood09@yahoo.com> wrote:

>I have a 145x1 size matrix and I'm trying to sum all of those elements within the matrix. An example would be a matrix like [ 1 2 3 4] would equal 10 because 4+3+2+1=10. 
>
>I've searched a while and any help would be great.

doc sum
0
Reply Richard 9/25/2010 9:19:26 PM


How did you search?  I cannot believe that you didn't come across the SUM function during your search, unless you didn't search using the terms which describe the problem.  Try this:

docsearch('sum')
0
Reply Matt 9/25/2010 9:20:29 PM

Matt Fig wrote:
> How did you search?  I cannot believe that you didn't come across the 
> SUM function during your search, unless you didn't search using the 
> terms which describe the problem.  Try this:
> 
> docsearch('sum')

or the inimitable

lookfor sum

:)

--
0
Reply dpb 9/25/2010 9:40:51 PM

3 Replies
291 Views

(page loaded in 0.129 seconds)

Similiar Articles:













7/24/2012 1:36:05 PM


Reply: