clc
clear
theta1= -10*(pi/180):0.01
for i = 1:length(theta)
    for l = 1:N;
    a(l,1)=exp(j*pi*sin(theta(i))*(l-1));
    end
    D1 = dx*(X'*a*a'*X); %incremental values
    D1 = D1/(a'*X*X'*a);
    D = D + D1; %sum of incremental values, approximation of integral
    
    
end