Hi everyone,
I have been working on this problem for a while and have found no feasible way of doing it.
I have a sphere of points defined by the coordinates X,Y and Z. For each of the point I would like to have a set of complete (i.e. vectors at each X,Y and Z point) vectors that points toward it. For example I can do this quite easily for one point:
R=22; phi=linspace(0,pi,50); theta=linspace(-pi/2,pi/2,50);[phi,theta]=meshgrid(phi,theta);X=R*sin(phi).*cos(theta); Y=R*sin(phi).*sin(theta); Z=R*cos(phi);P1x=22;P1y=0;P1z=0;X1=P1x-X; Y1=P1y-Y; Z1=P1z-Z;quiver3(X,Y,Z,X1,Y1,Z1)
As you can see this produces an array of vectors that points towards one point. I would like to do this for every point on the sphere. I'm unsure how to do this though because as I understand it you cannot have an array of arrays in matlab.
If anyone has any ideas they would be appreciated, thanks, John.
Best Answer