function [train_index,test_index]=data_seperate(rate)
for i=1:10
    if i<=5
        tt=[1 2 3 5 6 8]+9*(i-1);
        data{i}=[tt,45+tt,2*45+tt,3*45+tt,4*45+tt,5*45+tt,6*45+tt,7*45+tt];
    else
         tt=[4 7 9]+9*(i-6);
        data{i}=[tt,45+tt,2*45+tt,3*45+tt,4*45+tt,5*45+tt,6*45+tt,7*45+tt];
    end
end
train_index=[];
test_index=[];

for i=1:10
    [m,n]=size(data{i});
    num=max([m,n]);
    train_num=ceil(num*rate);
    index=randperm(num);
    
    train_index=[train_index,data{i}(index(1:train_num))];
    test_index=[test_index,data{i}(index(train_num+1:num))];
end
end
