Summation - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Summation

ChrissyChrissy Posts: 9Member
Hello, I have a question. I have a 2D array [372,4], the first bit looks like this:
0.07 0.11 0.21 0.34
1.12 0.77 1.17 1.1
0.24 0.11 0.21 0.37
2.53 2.11 3.24 3.07
0.69 0.49 0.32 0.52
2.04 1.72 2.26 2.01
0.01 0 0 0.06

I would like to add the columns together so I get one single column. If I had a fixed array of the size I mentioned, I would not have a problem, it would look something like:
FD[i]=FD[i,0]+FD[i,1]+FD[i,2]+FD[i,3]
no problem. However, I would like to be able to have a variable for my number of columns, so then my summation would look something like:
FD[i]=FD1[i,0]+FD1[i,1],FD1[i,2]+.....+FD1[i,n-1]+FD1[i,n]
and I am not sure how to or if it is possible to program this. Any clues? Thanks a bunch!!
Sign In or Register to comment.