finding the number of occurences
2 次查看(过去 30 天)
显示 更早的评论
I have values as
gene =
{6x5 cell}
{6x5 cell}
{5x4 cell}
{4x5 cell}
{3x5 cell}
{2x4 cell}
It consists of values as
gene{1,1}
'Genes' 'T0&T2' 'T2&T4' 'T4&T6' 'perc'
'YAR029W' 'd' 'd' 'd' 60
'YAR062W' 'du' 'ud' 'du' 60
'YBL095W' 'du' 'ud' 'du' 60
'YBR074W' 'du' 'ud' 'du' 60
'YBR138C' 'du' 'ud' 'du' 60
'YBR285W' 'du' 'ud' 'du' 60
I need as
'Genes' 'T0&T2' '' 'perc'
'YAR029W' 'd' '' 60
'YAR062W' 'du' 3 60
'YBL095W' 'du' 3 60
'YBR074W' 'du' 3 60
'YBR138C' 'du' 3 60
'YBR285W' 'du' 3 60
3 is the number of occurences it varies for other genes,please help
1 个评论
Azzi Abdelmalek
2012-9-3
编辑:Azzi Abdelmalek
2012-9-3
can you explain how occurrence is equal to 3 in this case. do you mean it's the columns number?
采纳的回答
Andrei Bobrov
2012-9-3
r = cell(size(gene))
for jj = 1:numel(r)
r{jj}(:,[1:2,4]) = gene{jj}(:,[1:2,end]);
r{jj}(:,3) = [repmat({''},2,1);repmat({3},size(r{jj},1)-2,1)];
end
0 个评论
更多回答(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!