resample.m

function [pointcorrespondence,done,x,p,n]          = resample(yy,nU);
done=[];
x=[];
pointcorrespondence=[];
for i=1:length(yy)
    done(i)=0;
end
R = randsample(1:length(yy),nU,false);
x(:,:)=yy(:,R);
done(R)=1;
pointcorrespondence=R;
[p,n]=size(x);

Project Homepage: