Plot energies in matlab