D=P2-P1
figure
for k=1:length(P1);
hold on;
quiver(P1(k,2), P1(k,1), D(k,2),D(k,1),0);
end
plot(P1(:,2), P1(:,1), '.b', 'markersize', 15)
plot(P2(:,2), P2(:,1), '.g', 'markersize', 20)
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!