[Scilab-users] issue with "sum"

2016-09-27 Thread paul . carrico
Hi again

In the following example, the sum lead to an opposite sign for the complex part 
… Am I doing something wrong ?

thanks for any highlight

Paul


mode(0)

A = [
- 3.
6.123D-17
3.
- 3.
- 3.062D-17 - 5.303D-17*%i
- 1.5 + 2.5980762*%i
- 3.
- 3.062D-17 + 5.303D-17*%i
 - 1.5 - 2.5980762*%i]

mat = matrix(A,3,3)

sum1 = sum(mat,'r')' // reference matrix

sum_c1 = sum(mat(:,1)) // sum of the 1rst column of sum1 matrix
sum_c2 = sum(mat(:,2)) // 2nd column of sum1 matrix
sum_c3 = sum(mat(:,3)) // 3rd column of sum1 matrix

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] issue with "sum"

2016-09-27 Thread Stéphane Mottelet

paul,

remember the transpose is *conjugate transpose*, use .' instead.

S.

Le 27/09/2016 à 15:04, paul.carr...@free.fr a écrit :

Hi again

In the following example, the sum lead to an opposite sign for the complex part 
… Am I doing something wrong ?

thanks for any highlight

Paul


mode(0)

A = [
- 3.
6.123D-17
3.
- 3.
- 3.062D-17 - 5.303D-17*%i
- 1.5 + 2.5980762*%i
- 3.
- 3.062D-17 + 5.303D-17*%i
  - 1.5 - 2.5980762*%i]

mat = matrix(A,3,3)

sum1 = sum(mat,'r')' // reference matrix

sum_c1 = sum(mat(:,1)) // sum of the 1rst column of sum1 matrix
sum_c2 = sum(mat(:,2)) // 2nd column of sum1 matrix
sum_c3 = sum(mat(:,3)) // 3rd column of sum1 matrix

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] issue with "sum"

2016-09-27 Thread paul . carrico
"remember"  heuhhh ... :-)

Thanks Stephane

- Mail original -
De: "Stéphane Mottelet" 
À: "Users mailing list for Scilab" 
Envoyé: Mardi 27 Septembre 2016 15:09:36
Objet: Re: [Scilab-users] issue with "sum"

paul,

remember the transpose is *conjugate transpose*, use .' instead.

S.

Le 27/09/2016 à 15:04, paul.carr...@free.fr a écrit :
> Hi again
>
> In the following example, the sum lead to an opposite sign for the complex 
> part … Am I doing something wrong ?
>
> thanks for any highlight
>
> Paul
>
> 
> mode(0)
>
> A = [
> - 3.
> 6.123D-17
> 3.
> - 3.
> - 3.062D-17 - 5.303D-17*%i
> - 1.5 + 2.5980762*%i
> - 3.
> - 3.062D-17 + 5.303D-17*%i
>   - 1.5 - 2.5980762*%i]
>
> mat = matrix(A,3,3)
>
> sum1 = sum(mat,'r')' // reference matrix
>
> sum_c1 = sum(mat(:,1)) // sum of the 1rst column of sum1 matrix
> sum_c2 = sum(mat(:,2)) // 2nd column of sum1 matrix
> sum_c3 = sum(mat(:,3)) // 3rd column of sum1 matrix
>
> ___
> users mailing list
> users@lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users