% An example of sorting some data.

% Consider a data set consisting of x,y pairs:
x = [62, 10, 43, 46, 34, 55, 15, 23, 50, 28, 59];
y = [47, 27, 28, 28, 29, 35, 31, 32, 30, 31, 41];

% Plot them.
figure(1)
hold off
plot(x, y, 'r^-', 'markersize', 15)  % Ugly!

% What  can we do to make the figure look right?

% Instead, plot data sorted by x.
s = cksort(x);  % See cksort.m, my cheesy sorting program.
figure(2)
hold off
plot(x(s), y(s), 'b^-', 'markersize', 15)

