You can do this with a few other clever calls to imfill. Here is a way, assuming your binary image is in the array BW:
Tmp = imfill(BW, 'holes');
Tmp2 = imfill(Tmp-BW, 'holes');
Res = Tmp - imfill(BW & Tmp2, 'holes');
and Res is a binary image that contains the desired output:
