help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Sum of all elements of a multi-dimensional matrix


From: Quentin Spencer
Subject: Re: Sum of all elements of a multi-dimensional matrix
Date: Fri, 04 Mar 2005 08:14:00 -0600
User-agent: Mozilla Thunderbird 0.9 (X11/20041127)

Deepak, R. wrote:

How can I find the sum of all elements of a multi-dimensional matrix?
octave:1> a=ones(3,3,3);
octave:2> sum(a(:))
ans = 27



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

[Prev in Thread] Current Thread [Next in Thread]