Try 1: Vectorize the Inner Two loops % Initialization nx1 = 10; nx2 = 10; [x1,x2 ...
blogs.mathworks.com