|
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 -------------------------------------------------------------
[Prev in Thread] | Current Thread | [Next in Thread] |