forming a cell array from matrix
조회 수: 1 (최근 30일)
이전 댓글 표시
I want to include the genes included in each cluster .
i have genedata =[1:1:100]
the code given below is for number of genes in cluster. Now i want to include the genes included
genedata=[1:1:100]
IDX = kmeans(genedata',20)
for i = 1:20
genenum(i) = sum(IDX == i);
end
댓글 수: 0
채택된 답변
Walter Roberson
2011년 11월 19일
First off, the loop you have is okay, but you could also replace it with the more efficient
genenum = accumarray(IDX(:));
As for including the genes included: you are not clear as to what you mean by that, so I will guess:
genes = cell(20,1);
for K = 1 : 20
genes{K} = genedata(IDX==K);
end
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Genomics and Next Generation Sequencing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!