This is small part of my code. I use a parfor loop here which is required for my project.
There are 60 different types of angle. But in my following code insted of taking all 60 types of diferent angle it is taking only 1 angle( the 60th poistion angle ). As result I am getting only one value for "a" and that repreated for the size of Npixels which is wrong. Can any one help me to tackle this problem?
If you run the code and see the : "Cords" variable your will find the "a" is repeated over the size of Npixels .
CODE::::::
Phi= deg2rad(linspace(startPhi,endPhi,Nangles));
B= [xv+(-1).*zs.*sin(theta),yv,zv+zs.*cos(theta),1];
Kai= repmat(B(:,1),Npixels,1);
Shai = repmat(B(:,2),Npixels,1);
G = repmat(B(:,3),Npixels,1);
sourceCords = [Kai,Shai,G];
IntersectionPts_Global = zeros((Npixels),4);
Phi= deg2rad(linspace(startPhi,endPhi,Nangles));
a =(zd+zv.*cos(phi+theta)+(-1).*xv.*sin(phi+theta)).*(g+zs+zv.*cos(phi+theta)+(-1).*xv.*sin(phi+theta)).^(-1).*(xv+kai.*cos(phi+theta)+(-1).*(g+zs).*sin(phi+theta));
InterPts_Global = [a,b,c,ones(length(a),1)];
IntersectionPts_Global(i,:) = InterPts_Global;
Cords = squeeze(IntersectionPts_Global(:,1:3));