[Scilab-users] issue with "sum"

paul.carrico at free.fr paul.carrico at free.fr
Tue Sep 27 15:04:35 CEST 2016


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




More information about the users mailing list