Displaying result more than 50%
古いコメントを表示
result =
{6x4 cell}
{5x4 cell}
{4x4 cell}
{3x4 cell}
In which the 4th column has percentage i want to display results having more thab 50 %
the 4th column contains different percentages,i want to display above 50% pleasae help
2 件のコメント
Azzi Abdelmalek
2012 年 9 月 4 日
編集済み: Azzi Abdelmalek
2012 年 9 月 4 日
percentage begins at the seond line? cn you post an example?
TAB
2012 年 9 月 4 日
Whay is your cell content exactly ? Do you want to display the whole row in which col4 > 50 or just values which are >50 ?
採用された回答
その他の回答 (1 件)
Azzi Abdelmalek
2012 年 9 月 4 日
編集済み: Azzi Abdelmalek
2012 年 9 月 4 日
for k=1:length(result)
A=result{k}
A=A([1 ;find(cell2mat(cellfun(@(x) x>50,A(2:end,4),'uni',false)))+1],:)
out{k}=A
end
%I suppose that your data looks like this
'Genes' 'T2&T4' 'T4&T6' 'perc'
'YAR029W' 'd' 'd' [ 60]
'YAR062W' 'ddu' 'ud1' [ 40]
'YBL095W' 'du' 'ud' [ 60]
14 件のコメント
kash
2012 年 9 月 4 日
Azzi Abdelmalek
2012 年 9 月 4 日
編集済み: Azzi Abdelmalek
2012 年 9 月 4 日
we have just to make this change
A=A([1 ;find(cell2mat(cellfun(@(x) x>50,A(2:end,4),'uni',false)))+1],:)
and why result{1,1} will not be displayed (60%>50%)
kash
2012 年 9 月 4 日
Azzi Abdelmalek
2012 年 9 月 4 日
it's corrected
A=A([1 ;find(cell2mat(cellfun(@(x) x>50,A(2:end,4),'uni',false)))+1],:)
kash
2012 年 9 月 4 日
Azzi Abdelmalek
2012 年 9 月 4 日
can you post sample of your data?
kash
2012 年 9 月 4 日
Azzi Abdelmalek
2012 年 9 月 4 日
that does not match what you posted in your question. it was about 4 columns
Azzi Abdelmalek
2012 年 9 月 4 日
then the change will be
for k=1:length(result)
A=result{k};m=size(A,2)
A=A([1 ;find(cell2mat(cellfun(@(x) x>50,A(2:end,m),'uni',false)))+1],:)
out{k}=A
end
kash
2012 年 9 月 4 日
Azzi Abdelmalek
2012 年 9 月 4 日
no, try the corrected code without reducing anything
Azzi Abdelmalek
2012 年 9 月 4 日
you said to only display some rows with condition, it's obvious sizes will change
kash
2012 年 9 月 4 日
Azzi Abdelmalek
2012 年 9 月 4 日
編集済み: Azzi Abdelmalek
2012 年 9 月 4 日
for the example below what should be the answer
'Genes' 'T0&T2' 'ee' 'T4&T6' 'perc'
'YBR074W' 'du' 'rr' 'du' [ 60]
'YBR138C' 'du' 'rr' 'du' [ 60]
'YBR285W' 'du' 'rr' 'du' [ 40]
% I guess
'Genes' 'T0&T2' 'ee' 'T4&T6' 'perc'
'YBR074W' 'du' 'rr' 'du' [ 60]
'YBR138C' 'du' 'rr' 'du' [ 60]
カテゴリ
ヘルプ センター および File Exchange で Elementary Math についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!