Expectation value in matlab need help

I want to replace the following inverse matrix (X'*X)^-1 with its expectation value:

E{(X'*X)^-1} = E{|1/Xk|^2}I

X'*X and (X'*X)^-1 is a diagonal matrix. Could anyone give me an Idea how to write it in matlab this expectation value. The elements of a matrix X are composed by QPSK symbols, or 16-QAM, or 64-QAM. Assume for now QPSK.

Assuming the same
signal constellation on all tones and equal probability on all constellation points.