In Matlab I have two Nx3 matrices P and Q and each line represents a point.
I want to plot lines between the points that are in the same row of the matrices.
Following Code does it:
for i=1:N
plot3( [P(i,1) Q(i,1)], ...
[P(i,2) Q(i,2)], ...
[P(i,3) Q(i,3)] )
end
Is there a way to do it without a for-loop?
If I give plot3 the points just as vectors, Matlab draws lines between Q(i,:) and P(i+1,:) in addition to the lines I want.