You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: finddisconnsurf.m
    path of file: ./repos/fieldtrip/external/iso2mesh
    
    the code of the file until where you have to start completion: function facecell=finddisconnsurf(f)
%
% facecell=finddisconnsurf(f)

    
function facecell=finddisconnsurf(f)
%
% facecell=finddisconnsurf(f)
% 
% subroutine to extract disconnected surfaces from a 
% cluster of surfaces
% 
% author: Qianqian Fang (fangq@nmr.mgh.harvard.edu)
% Date: 2008/03/06
%
% input: 
%     f: faces defined by node indices for all surface triangles
%
% output:
%     facecell: separated disconnected surface node indices
%
% -- this function is part of iso2mesh toolbox (http://iso2mesh.sf.net)
%

facecell={};
subset=[];
while(~isempty(f))
	idx=reshape(ismember(f,f(1,:)), size(f));
	ii=find(sum(idx,2));
	while(~isempty(ii))
		if(isempty(ii)) break; end