Displaying result more than 50%
Ältere Kommentare anzeigen
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 Kommentare
Azzi Abdelmalek
am 4 Sep. 2012
Bearbeitet: Azzi Abdelmalek
am 4 Sep. 2012
percentage begins at the seond line? cn you post an example?
TAB
am 4 Sep. 2012
Whay is your cell content exactly ? Do you want to display the whole row in which col4 > 50 or just values which are >50 ?
Akzeptierte Antwort
Weitere Antworten (1)
Azzi Abdelmalek
am 4 Sep. 2012
Bearbeitet: Azzi Abdelmalek
am 4 Sep. 2012
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 Kommentare
kash
am 4 Sep. 2012
Azzi Abdelmalek
am 4 Sep. 2012
Bearbeitet: Azzi Abdelmalek
am 4 Sep. 2012
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
am 4 Sep. 2012
Azzi Abdelmalek
am 4 Sep. 2012
it's corrected
A=A([1 ;find(cell2mat(cellfun(@(x) x>50,A(2:end,4),'uni',false)))+1],:)
kash
am 4 Sep. 2012
Azzi Abdelmalek
am 4 Sep. 2012
can you post sample of your data?
kash
am 4 Sep. 2012
Azzi Abdelmalek
am 4 Sep. 2012
that does not match what you posted in your question. it was about 4 columns
Azzi Abdelmalek
am 4 Sep. 2012
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
am 4 Sep. 2012
Azzi Abdelmalek
am 4 Sep. 2012
no, try the corrected code without reducing anything
Azzi Abdelmalek
am 4 Sep. 2012
you said to only display some rows with condition, it's obvious sizes will change
kash
am 4 Sep. 2012
Azzi Abdelmalek
am 4 Sep. 2012
Bearbeitet: Azzi Abdelmalek
am 4 Sep. 2012
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]
Kategorien
Mehr zu Elementary Math finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!