elem=removedupelem(elem) remove doubly duplicated (folded) elements author: Qianqian Fang, <q.fang at neu.edu> input: elem: list of elements (node indices) output: elem: element list after removing the duplicated elements -- this function is part of iso2mesh toolbox (http://iso2mesh.sf.net)
0001 function elem=removedupelem(elem) 0002 % 0003 % elem=removedupelem(elem) 0004 % 0005 % remove doubly duplicated (folded) elements 0006 % 0007 % author: Qianqian Fang, <q.fang at neu.edu> 0008 % 0009 % input: 0010 % elem: list of elements (node indices) 0011 % 0012 % output: 0013 % elem: element list after removing the duplicated elements 0014 % 0015 % -- this function is part of iso2mesh toolbox (http://iso2mesh.sf.net) 0016 % 0017 0018 [el,count1,count2]=unique(sort(elem')','rows'); 0019 bins=hist(count2,1:size(elem,1)); 0020 cc=bins(count2); 0021 elem(find(cc>0&mod(cc,2)==0),:)=[];