Note that there are some explanatory texts on larger screens.

plurals
  1. POmatlab: help in ordering cells contents
    text
    copied!<p>This is a part of my code that I need to pick one element from input. The very final result is sorted in a strange way that will create 1X2 cells instead of put them next to each other! </p> <pre><code> struKm(i).seqNam = cellstr(regexp(data(i).Header, '\s\||\:|\|','split')); % determen the seqance name heads struKm(i).seqNam(cellfun(@(x) isempty(x),struKm(i).seqNam))=[]; </code></pre> <p>This code is in a FOR LOOP. </p> <p>the result for this code is: </p> <p>ans = </p> <pre><code>'AF051909' '392-397' 'CAGCTG' '413-418' 'CAGGTG' </code></pre> <p>some seqNams contain only one Binding site (CAGCTG). for Example: </p> <p>ans = </p> <pre><code>'M13483' '445-450' 'CAACTG' </code></pre> <p>Now I want to pick the Binding sites only which are (CAGCTG, CAGGTG, CAACTG , ... etc)</p> <p>I have another for loop that will do it. The code: </p> <p>struSize = length(struKm); tempcell = cell(1,1);</p> <p>for m=1:struSize</p> <pre><code>if (length(struKm(m).seqNam) == 3) resultsk.BS{m} = struKm(m).seqNam(3); disp(m); end if (length(struKm(m).seqNam) == 5) resultsk.BS{m} = cellstr(struKm(m).seqNam([3,5])); %tempcell = struKm(m).seqNam([3,5]); resultsk.BS{m} = cellstr(tempcell); disp(m); end </code></pre> <p>end</p> <p>and the result for this code: </p> <blockquote> <blockquote> <p>resultsk.BS{:}</p> </blockquote> </blockquote> <p>ans = </p> <pre><code>'CAGCTG' 'CAGGTG' </code></pre> <p>ans = </p> <pre><code>'CAACTG' </code></pre> <p>ans = </p> <pre><code>'CAACTG' </code></pre> <p>The problem with some cells that have two binding sites which made the &lt;1x2 cell> next to &lt;1x1 cell>. </p> <p>I need them all in one row. still struggling with this. Can you please help? </p> <p>Thank you, A</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload