finding the number of occurences

2 ビュー (過去 30 日間)
Pat
Pat 2012 年 9 月 3 日
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
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
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 件)

カテゴリ

Help Center および File ExchangeGenomics and Next Generation Sequencing についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by