Matrix P is a real-valued matrix and the H matrices are complex-valued matrices. I have found a way to do it without looping.
function [ GAMMA ] = gamma_dnc( P,Hh,Ht )
%GAMMA_DNC Calculates the component GAMMA in the DNC
% beamforming matrix V.
% Store transposes of matrices to reduce
% function call overhead
Hh_tp = Hh';
Ht_tp = Ht';
% Compute intermediate products
H1 = Ht*Hh_tp;
H2 = Hh*Ht_tp;
H3 = Ht*Ht_tp;
H4 = H1 + H2 + H3;
H5 = P(1,1)*H4; % All users transmit with equal power
T = sum(H5); % Find sum of all columns
GAMMA = mean(T)/10; % Have to divide by 10 for some reason