% compute first two components of MDS transform
cities_dist_table;

[Y, eigenval] = cmdscale (D, 2);
Y = -Y;     %rotate 180 degrees
Xc = Y(:, 1);
Yc = Y(:, 2);

% create a table with Xc Yc -- city locations
cityloc = table(city, Xc, Yc);

%plot city locations
figure();

s = scatter(cityloc, 'Xc', 'Yc', 'SizeData', 200, ...
            'MarkerFaceColor', 'black');
margin_factor = 1.5;
axis(reshape([min(Y)*margin_factor; max(Y)*margin_factor], 1, []));
grid;