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에서 Calendar에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!