Look at this simple matlab program to determine MIMO channel capacity with Monte Carlo realization. , i hope that can be help you to solve your problem.
clear
clc
SNR_dB=[0:12];
SNR_linear=10.^(SNR_dB/10);
nT=3; nR=3; % 3x3 Tx and Rx antennas
n=min(nT,nR); % determine the rank of channel matrix
I = eye(n);
N_trial= 100; % Monte Carlo (Number of realization)