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: Adding rows in a matrix based on certain criteria
Replies: 2   Last Post: Feb 7, 2013 9:58 AM

Advanced Search

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

Posts: 9,850
Registered: 6/7/07
Re: Adding rows in a matrix based on certain criteria
Posted: Feb 7, 2013 9:46 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

On 2/7/2013 6:43 AM, Kumar wrote:
> ... add rows in matrix based on certain criteria. For example, if
> the values in column 1 is 1 and values in cloumn 2 is 1, then i have to
> add elements in colum 3 of all such rows....

s-sum(x(((x(:,1)==1) & (x(:,2)==1)),3));


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.