Your statement is correct for the movies, but I think the extended universe (maybe a comic or the original script) did state the humans were used for compute, not energy. It was dumbed down for the films.
See my comment on the sibling thread. This take has been repeatedly claimed online, but nobody brings any evidence other than fanfic.
Ironically, if you ask Google, the Gemini Annoyance AI [1] confidently asserts that what you're saying is true, but if you follow the links they give, none of them support the claim, and the further you click, the more it becomes people repeating each other's speculation and hearsay and calling it evidence. For example:
https://scifi.stackexchange.com/questions/19817/was-executiv...
Typical internet story.
[1] Aside: I am far more worried about the influence of AI gaslighting on mushy-brained humans than I am on AI destroying the human race. The dystopic future of AI is people.
The “using humans for compute” angle makes no sense either, if you’re living in the Matrix, your brain is obviously occupied processing the Matrix. The way to do it would be to trap humans in virtual classrooms and force them to solve math problems.
I've seen all four films plus "The Animatrix" and played two of the games and don't recall this at all. Contemporarily, however, there was an episode of Star Trek: Enterprise [1] that used this as a key plot point.
[1] https://en.wikipedia.org/wiki/Dead_Stop