I am trying to find the d-band center of pdos data generated using quantum espresso 6.8. I'm aware that this maybe calculated by the formula:
$$ \frac{\int_{-\infty}^\infty E \cdot \textrm{pdos}(E)dE}{\int_{-\infty}^\infty \textrm{pdos}(E)dE} \tag{1}$$
I tried XMgrace as suggested here but was not able to do it. Is there a way to use this formula using MatLab, or any other software to integrate the pdos curve (maybe a piece of code)? Any help would be appreciated :)