ClB=fastaread('R.txt'); sqs=cell2mat({ClB.Sequence}'); [N,L]=size(sqs); for i=1:L for j=1:100 a(:,i,j)=sqs(randperm(N)',i); end end