I have two vectors, one containing sampled energies and the other one for each of these energies a weight: e(i) and w(i).
I bin the energies e(i). Now I want to compute the sum of weights w in each bin separately.
I can bin the energies using BinLists and make a plot with Histogram. How do I perform the sum over weights in each bin? I would obviously need access to the indices i in each bin.
Any elegant solution to this problem would be welcome.
e = {0.129454, 0.160294, 0.140456, 0.152359, 0.174006, 0.186969};
w = {2.12373*10^-6, 0.00029488, 5.68648*10^-6, 0.000100244, 2.28126*10^-6, 6.74131*10^-6};
Comments
Post a Comment