The Math Forum

Search All of the Math Forum:

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

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

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

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,929
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"
<> 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) ;


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]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.