help-octave
[Top][All Lists]
Advanced

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

Re: sum element of columns


From: Marco Atzeri
Subject: Re: sum element of columns
Date: Wed, 17 Oct 2018 08:58:43 +0200
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1

Am 17.10.2018 um 00:54 schrieb turbofib:
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]


octave:1> a=[1 4 6 3; 6 5 4 3;9 7 3 5; 3 4 1 3]
a =

   1   4   6   3
   6   5   4   3
   9   7   3   5
   3   4   1   3

octave:2> b=[0 0 0 1; 0 0 1 1 ; 0 1 1 1; 1 1 1 1]
b =

   0   0   0   1
   0   0   1   1
   0   1   1   1
   1   1   1   1

octave:3> a*b
ans =

    3    9   13   14
    3    7   12   18
    5    8   15   24
    3    4    8   11

---
Diese E-Mail wurde von Avast Antivirus-Software auf Viren gepr├╝ft.
https://www.avast.com/antivirus




reply via email to

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