You can first fill in the object using imfill
, then trace it using bwboundaries
, and plot the result using plot
with a given line style.
% Load the image in and convert to binary
img = imread('https://i.stack.imgur.com/G4NLh.png');
img = img(:,:,1) > 170;
% Fill in the middle hole and compute the boundary
boundary = bwboundaries(imfill(img, 'holes'));
% Plot the boundary on a black background
plot(boundary{1}(:,2), boundary{1}(:,1), ...
'LineStyle', '-.', ...
'Marker', 'none')
axis image
axis ij

Update
Oh...you already have the x/y points. Oh well! Just use the LineStyle
property of plot to accomplish what you want.