Howdy, Stranger!

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

Sign In with Facebook Sign In with Google Sign In with OpenID

Categories

We have migrated to a new platform! Please note that you will need to reset your password to log in (your credentials are still in-tact though). Please contact lee@programmersheaven.com if you have questions.
Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

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.