I have this so far to try and get my plotting correct.
xCor = rand(1,10)
yCor = rand(1,10)
Cor = [xCor; yCor]
subplot(1,1,1);
plot(xCor,yCor,'r.','MarkerSize',20)
c = randperm(10,10)
x1 = Cor(1,c(1))
y1 = Cor(2,c(1))
x2 = Cor(1,c(2))
y2 = Cor(2,c(2))
hold on;
plot([x1 y1],[x2,y2])
I create my Coordinate set Cor and plot the individual x and y points. I then create a random permutation so that i can select random Columns from Cor. When the numbers are printed out for x1, y1 etc . . they all match with the numbers in Cor and the numbers that were plotted but the plotted line does not relate to any points on my figure . . .despite having the same co ordinates.