HOW TO DIVIDE RANDOMLY

a=[1 9 2 4 3 5 4 6 5 1 6 9 7 0 8 3 9 1 0 2 3 6 3 4 3 7 8 1 8 7 9 2 0 3 4 6 5 7 8 9 ] i want to divide this data into 5 groups RANDOMLY so taht the values in the column 1 and 2 should not change....... have to do this for large data also,can anyone help the output must be

 채택된 답변

Andrei Bobrov
Andrei Bobrov 2011년 9월 19일

0 개 추천

r = 5;
n = size(a,1);
k = n/r;
groups5 = reshape(permute(reshape(a(randperm(n),:),k,[],2),[1 3 2]),k,[]);

추가 답변 (1개)

Andreas Goser
Andreas Goser 2011년 9월 19일

0 개 추천

  1. Move the data into the five groups as they are
  2. Create a set of random numbers with indices, e.g. (1,5), (2,3) etc.
  3. Flip the data using the random indices, e.g. flip data point group 1, element 5 with group 2, element 3
  4. Do this a reasonable amount of times

댓글 수: 3

Andreas Goser
Andreas Goser 2011년 9월 19일
Looks like you are going to the same university:
http://www.mathworks.com/matlabcentral/answers/16045-how-to-sort-into-groups
Pat
Pat 2011년 9월 19일
can u tell how to do this,please
Create a set of random numbers with indices, e.g. (1,5), (2,3) etc.
Pat
Pat 2011년 9월 19일
I am working on ACCURATAE CANCER CLASSIFICATION FOR EXPRESSION OF VERY FEW GENES,T HAVE TO DO THIS PROCESS
use 2 or 3 genes from top 100 to generate a combination FCI,i have 4026 genes ,can anyone tell how to process PLZ

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Genomics and Next Generation Sequencing에 대해 자세히 알아보기

태그

질문:

Pat
2011년 9월 19일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by