Skeletonize the blob with bwmorph(), then use bwmorph() again to find the endpoints. Use regionprops() to get coordinates of the skeleton so you know which endpoints belong to the same blob. Then use imline() to draw a line connecting the endpoints of each blob. Demo of imline used to burn a line into an image is attached. Please try these steps yourself first and come back with your code if you can't do it. Again, the rough steps are
bwmorph(binaryImage, 'skel', inf);
[labeledImage, numBlobs] = bwlabel(binaryImage);
measurements = regionprops(labeledImage, 'PixelList');
for k = 1 : numBlobs
Finish it up (it shouldn't be too hard) and let me know of any problems.