N = 3;

M = 1000;
alpha = linspace(-2*pi,2*pi,1000);
I = zeros(1,M);
for i = 1:M
    if (sin(alpha(i)) ~= 0)
        I(i) = (sin(N*alpha(i))/sin(alpha(i)))^2;
    else
        I(i) = N^2;
    end
end
hold on;
plot(alpha,I,'k');

xlabel('\alpha, can be related to physical angle \theta');
ylabel('Relative intensity');
title('Effect of incorporating multiple slits');