function [out] = bootstrap(data,B)
%
% Bootstrap method -produce B dataSet
%
% Inputs:
% data:origianl data set whose size is [M,N],which means feature Dimens is M and the original dataset contains N samples
% B:number of dataSet
% Outputs:
% out:B bootstrap resamples of the input data whose size is [M,N,B]
[M,N]=size(data);
if (exist('B')~=1), B=N; end;
out=zeros(M,N,B);
index=unidrnd(N,N,B);
out=reshape(data(:,index),M,N,B);
end