help-octave
[Top][All Lists]
Advanced

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

Re: sum element of columns


From: Montgomery-Smith, Stephen
Subject: Re: sum element of columns
Date: Wed, 17 Oct 2018 04:33:02 +0000

b = a * flip(triu(ones(size(a)(2))))


From: Help-octave <help-octave-bounces+address@hidden> on behalf of turbofib <address@hidden>
Sent: Tuesday, October 16, 2018 5:54:33 PM
To: address@hidden
Subject: Re: sum element of columns
 
thank you

i ask you another question ;

a[1 4 6 3; 6 5 4 3;9 7 3 5; 3 4 1 3]

i want this:



3    3+6   3+6+4  3+6+4+1   first row

3    3+4   3+4+5  3+4+5+6   second row

5    5+3   5+3+7  5+3+7+9   third row

3    3+1   3+1+4  3+1+4+3   four row


result=

B=[3 9 13 14;3 7 12 18;5 8 15 24;3 4 8 11] 




--
Sent from: http://octave.1599824.n4.nabble.com/Octave-General-f1599825.html



reply via email to

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