How to find a non-zero number between two zeros in a cell array in matlab
<p>I have a cell array <code>(11000x500)</code> with three different type of elements. 
1) Non-zero doubles
2) zero
3) Empty cell</p>

<p>I would like to find all occurances of a non-zero number between two zeros.</p>

<p>E.g. <code>A = {123 13232 132 0 56 0 12 0 0 [] [] []};</code></p>

<p>I need the following output 
<code>out = logical([0 0 0 0 1 0 1 0 0 0 0 0]);</code></p>

<p>I used <code>cellfun</code> and  <code>isequal</code> like this</p>

<pre><code>out = cellfun(@(c)(~isequal(c,0)), A);
</code></pre>

<p>and got the follwoing output</p>

<pre><code>out = logical([1 1 1 0 1 0 1 0 0 1 1 1]);
</code></pre>

<p>I need help to perform the next step where i can ignore the consecutive <code>1's</code> and only take the '1's'  between two <code>0's</code></p>

<p>Could someone please help me with this?</p>

<p>Thanks!</p>