I have this first version, working, of a analysis loop. This netsted for loop is simply analysing a geometric problem involving points.
The problem is, it is much too slow, as a big amount of points needs to be processed.
Previous calculation and assignment, causing the following vectors:
D = zeros(size(B,2),size(A,2));
alpha = acos(dot(A(:,i),C)/norm(A(:,i))/norm(C));
beta = pi-acos(dot(B(:,k),C)/norm(B(:,k))/norm(C));
if((alpha <= (vis)) && beta >= pi/2)
Vectorizing this loop appears to be quite difficult, at least for me, e.g. because of the functions (dot product, norm etc,) beeing called within the loop. I got stuck here when trying to vectorize.
Are there any ideas or concrete approaches on your minds to inprove this loops' performance?