A blunt force method would be to have two for loops, one nested in the other. In the inner for loop, sum over the 'i' variables, and in the outer loop sum over the 'p' variables. This could look like:
AF = ;
AF = AF + I(p,i)*exp(1i*k*r(p)*sin(theta)*cos(phi0 - phi(p,i)) + alpha(p,i))
AF = 1 + AF;
A more elegant solution would use matrix operations.