The attached plot is as you can see an array of points in 3D. The lines link points from the XY plane with points along the Z-axis. They are suppose to be vectors, however when I plot with quiver3 I get a vector facing normal to the XY surface, instead of what I would like it pointing towards the points toward the Z-axis, if that makes sense.
Below you can see a part of the code:
F{j,i}(k,1) = r*cos(k*teta);
F{j,i}(k,2) = r*sin(k*teta);
F{j,i}(k,3) = 0 - (j-1)*(s+a)*1e3;
rout{j,i}(l,1)=sqrt(((F{j,i}(k,1)-calc_area(l,1))^2)+((F{j,i}(k,2)-calc_area(l,2))^2)+((F{j,i}(k,3)-calc_area(l,3))^2));
scatter3(F{j,i}(k,1),F{j,i}(k,2),F{j,i}(k,3),'k.')
In the end I wish to calculate the magnitude of vectors between points of F and and calc_area.
where calc_area has points x,y=0 and z=5 to 100; I attempted to calculate the magnitude and saved it in rout cell. Then I have teta2, where I am calculating the angle, however it yields around 90 degrees. For the red line this should be very small... and for the blue line around 30 degrees from visual inspection. What am I doing wrong here?
Thank you for any help.