Welcome to the new platform of Programmers 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 it's exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.
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:
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:
and I am not sure how to or if it is possible to program this. Any clues? Thanks a bunch!!