function [resData,resIndex]=resampling(data,newSize) [dataDim dataSize]=size(data); rand('state',sum(100*clock)); tmpIndex=dataSize*rand(newSize,1); resIndex=fix(tmpIndex)+1; resData=data(:,resIndex);