Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: summation of matrix rows
Replies: 3   Last Post: Jun 17, 2006 3:38 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Roger Stafford

Posts: 5,888
Registered: 12/7/04
Re: summation of matrix rows
Posted: Jun 17, 2006 3:37 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

In article <ef39a1a.-1@webcrossing.raydaftYaTP>, "Huey Lewis"
<J_paulett@hotmail.com> wrote:

> I am trying to find the summation of each row of a Matrix A. Is
> there any way I can change the rows to columns and use the sum
> function?

--------------
Two ways:

s = sum(A,2) ;

Or:

s = sum(A.').' ;

Each method will produce a column vector of row sums.

(Remove "xyzzy" and ".invalid" to send me email.)
Roger Stafford



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.