Energy, which is as follows:
can be found based on the MATLAB document
If I'm not wrong:
ans=sum(a(:).^2)/sum(a(:)).^2