<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/263922</link>
    <title>MATLAB Central Newsreader - cell array</title>
    <description>Feed for thread: cell array</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2012 by MathWorks, Inc.</copyright>
    <webmaster>webmaster@mathworks.com</webmaster>
    <generator>MATLAB Central Newsreader</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>
    <image>
      <title>MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Fri, 23 Oct 2009 08:22:01 -0400</pubDate>
      <title>cell array</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/263922#689203</link>
      <author>sujata </author>
      <description>I have a 5 by 2 cell array that is only filled with numbers. Something like this:&lt;br&gt;
Z = &lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;[ 1.6168]    [ 0.8652]&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[ 0.5724]    [ 0.2323]&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[ 2.5916]    [ 2.6805]&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[-5.1700]    [      0]&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[ 1.4836]    [ 0.4542]&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[-0.1367]    [      0]&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[ 2.5100]    [ 2.9110]&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[]           []&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[ 1.7531]    [ 1.7531]&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[-0.6462]    [-0.6462]&lt;br&gt;
&lt;br&gt;
but i want to take the difference between these two columns. Since it is an cell array this is not possible to simply do Z(:,1)-Z(:,2).&lt;br&gt;
&lt;br&gt;
I could use a for loop but i want to avoid using that. I also looked in the documentation for cell conversions but so far no luck. &lt;br&gt;
&lt;br&gt;
Does anyone know (if) there is an alternative way to do this?&lt;br&gt;
&lt;br&gt;
Thanks</description>
    </item>
    <item>
      <pubDate>Fri, 23 Oct 2009 08:51:34 -0400</pubDate>
      <title>Re: cell array</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/263922#689209</link>
      <author>arun</author>
      <description>On Oct 23, 10:22&#160;am, &quot;sujata &quot; &amp;lt;sujat...@gmail.com&amp;gt; wrote:&lt;br&gt;
&amp;gt; I have a 5 by 2 cell array that is only filled with numbers. Something like this:&lt;br&gt;
&amp;gt; Z =&lt;br&gt;
&amp;gt; &#160; &#160;[ 1.6168] &#160; &#160;[ 0.8652]&lt;br&gt;
&amp;gt; &#160; &#160; [ 0.5724] &#160; &#160;[ 0.2323]&lt;br&gt;
&amp;gt; &#160; &#160; [ 2.5916] &#160; &#160;[ 2.6805]&lt;br&gt;
&amp;gt; &#160; &#160; [-5.1700] &#160; &#160;[ &#160; &#160; &#160;0]&lt;br&gt;
&amp;gt; &#160; &#160; [ 1.4836] &#160; &#160;[ 0.4542]&lt;br&gt;
&amp;gt; &#160; &#160; [-0.1367] &#160; &#160;[ &#160; &#160; &#160;0]&lt;br&gt;
&amp;gt; &#160; &#160; [ 2.5100] &#160; &#160;[ 2.9110]&lt;br&gt;
&amp;gt; &#160; &#160; &#160; &#160; &#160; &#160;[] &#160; &#160; &#160; &#160; &#160; []&lt;br&gt;
&amp;gt; &#160; &#160; [ 1.7531] &#160; &#160;[ 1.7531]&lt;br&gt;
&amp;gt; &#160; &#160; [-0.6462] &#160; &#160;[-0.6462]&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; but i want to take the difference between these two columns. Since it is an cell array this is not possible to simply do Z(:,1)-Z(:,2).&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; I could use a for loop but i want to avoid using that. I also looked in the documentation for cell conversions but so far no luck.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Does anyone know (if) there is an alternative way to do this?&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Thanks&lt;br&gt;
&lt;br&gt;
help cell2mat&lt;br&gt;
&lt;br&gt;
but the problem is that if your cell has [] in both the columns, the&lt;br&gt;
entry will be eliminated. I suggest you just replace the empty values&lt;br&gt;
with 0's and then convert using cell2mat and perform the operations&lt;br&gt;
and then convert back to cell if necessary...&lt;br&gt;
&lt;br&gt;
but, if all your values are cell, then why go for cell? it just takes&lt;br&gt;
up more space..&lt;br&gt;
&lt;br&gt;
best, arun.</description>
    </item>
    <item>
      <pubDate>Fri, 23 Oct 2009 08:57:04 -0400</pubDate>
      <title>Re: cell array</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/263922#689210</link>
      <author>Vinayagam </author>
      <description>Try this one,&lt;br&gt;
&lt;br&gt;
[Z{:,1}]'-[Z{:,2}]'.&lt;br&gt;
&lt;br&gt;
--&lt;br&gt;
Vinayagam.&lt;br&gt;
&lt;br&gt;
&quot;sujata &quot; &amp;lt;sujatagp@gmail.com&amp;gt; wrote in message &amp;lt;hbrp39$me3$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; I have a 5 by 2 cell array that is only filled with numbers. Something like this:&lt;br&gt;
&amp;gt; Z = &lt;br&gt;
&amp;gt;    [ 1.6168]    [ 0.8652]&lt;br&gt;
&amp;gt;     [ 0.5724]    [ 0.2323]&lt;br&gt;
&amp;gt;     [ 2.5916]    [ 2.6805]&lt;br&gt;
&amp;gt;     [-5.1700]    [      0]&lt;br&gt;
&amp;gt;     [ 1.4836]    [ 0.4542]&lt;br&gt;
&amp;gt;     [-0.1367]    [      0]&lt;br&gt;
&amp;gt;     [ 2.5100]    [ 2.9110]&lt;br&gt;
&amp;gt;            []           []&lt;br&gt;
&amp;gt;     [ 1.7531]    [ 1.7531]&lt;br&gt;
&amp;gt;     [-0.6462]    [-0.6462]&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; but i want to take the difference between these two columns. Since it is an cell array this is not possible to simply do Z(:,1)-Z(:,2).&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I could use a for loop but i want to avoid using that. I also looked in the documentation for cell conversions but so far no luck. &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Does anyone know (if) there is an alternative way to do this?&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Thanks</description>
    </item>
    <item>
      <pubDate>Fri, 23 Oct 2009 09:16:03 -0400</pubDate>
      <title>Re: cell array</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/263922#689215</link>
      <author>Branko </author>
      <description>&quot;Vinayagam &quot; &amp;lt;bkvinay2001@yahoo.com&amp;gt; wrote in message &amp;lt;hbrr50$gfq$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; Try this one,&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; [Z{:,1}]'-[Z{:,2}]'.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; --&lt;br&gt;
&amp;gt; Vinayagam.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &quot;sujata &quot; &amp;lt;sujatagp@gmail.com&amp;gt; wrote in message &amp;lt;hbrp39$me3$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; I have a 5 by 2 cell array that is only filled with numbers. Something like this:&lt;br&gt;
&amp;gt; &amp;gt; Z = &lt;br&gt;
&amp;gt; &amp;gt;    [ 1.6168]    [ 0.8652]&lt;br&gt;
&amp;gt; &amp;gt;     [ 0.5724]    [ 0.2323]&lt;br&gt;
&amp;gt; &amp;gt;     [ 2.5916]    [ 2.6805]&lt;br&gt;
&amp;gt; &amp;gt;     [-5.1700]    [      0]&lt;br&gt;
&amp;gt; &amp;gt;     [ 1.4836]    [ 0.4542]&lt;br&gt;
&amp;gt; &amp;gt;     [-0.1367]    [      0]&lt;br&gt;
&amp;gt; &amp;gt;     [ 2.5100]    [ 2.9110]&lt;br&gt;
&amp;gt; &amp;gt;            []           []&lt;br&gt;
&amp;gt; &amp;gt;     [ 1.7531]    [ 1.7531]&lt;br&gt;
&amp;gt; &amp;gt;     [-0.6462]    [-0.6462]&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; but i want to take the difference between these two columns. Since it is an cell array this is not possible to simply do Z(:,1)-Z(:,2).&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; I could use a for loop but i want to avoid using that. I also looked in the documentation for cell conversions but so far no luck. &lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; Does anyone know (if) there is an alternative way to do this?&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&lt;br&gt;
Why do you need cell array? If you have mix type of data (string,numeric) or different size of arrays is good otherwise as, Arun mentioned transform to matrix and do your operation. &lt;br&gt;
&lt;br&gt;
Moreover, be careful about empty cells - replace them with NaN and NOT 0 since this represents number!&lt;br&gt;
&lt;br&gt;
Very useful function to look is bsxfun.&lt;br&gt;
&lt;br&gt;
Branko</description>
    </item>
    <item>
      <pubDate>Fri, 23 Oct 2009 09:34:20 -0400</pubDate>
      <title>Re: cell array</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/263922#689222</link>
      <author>sujata </author>
      <description>The reason that the cell is used is because I draw the data from a database and it puts it automatically into an cell array since it consists of numeric and strings.&lt;br&gt;
But then i select only the columns which I need and incidentally this is the data.&lt;br&gt;
&lt;br&gt;
That's why i am trying to filter out the cell. &lt;br&gt;
&lt;br&gt;
Thanks for the ideas&lt;br&gt;
&lt;br&gt;
&quot;Branko &quot; &amp;lt;bogunovic@mbss.org&amp;gt; wrote in message &amp;lt;hbrs8j$6h3$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &quot;Vinayagam &quot; &amp;lt;bkvinay2001@yahoo.com&amp;gt; wrote in message &amp;lt;hbrr50$gfq$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; Try this one,&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; [Z{:,1}]'-[Z{:,2}]'.&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; --&lt;br&gt;
&amp;gt; &amp;gt; Vinayagam.&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &quot;sujata &quot; &amp;lt;sujatagp@gmail.com&amp;gt; wrote in message &amp;lt;hbrp39$me3$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; I have a 5 by 2 cell array that is only filled with numbers. Something like this:&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; Z = &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt;    [ 1.6168]    [ 0.8652]&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt;     [ 0.5724]    [ 0.2323]&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt;     [ 2.5916]    [ 2.6805]&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt;     [-5.1700]    [      0]&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt;     [ 1.4836]    [ 0.4542]&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt;     [-0.1367]    [      0]&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt;     [ 2.5100]    [ 2.9110]&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt;            []           []&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt;     [ 1.7531]    [ 1.7531]&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt;     [-0.6462]    [-0.6462]&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; but i want to take the difference between these two columns. Since it is an cell array this is not possible to simply do Z(:,1)-Z(:,2).&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; I could use a for loop but i want to avoid using that. I also looked in the documentation for cell conversions but so far no luck. &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; Does anyone know (if) there is an alternative way to do this?&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Why do you need cell array? If you have mix type of data (string,numeric) or different size of arrays is good otherwise as, Arun mentioned transform to matrix and do your operation. &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Moreover, be careful about empty cells - replace them with NaN and NOT 0 since this represents number!&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Very useful function to look is bsxfun.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Branko</description>
    </item>
    <item>
      <pubDate>Fri, 23 Oct 2009 09:37:21 -0400</pubDate>
      <title>Re: cell array</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/263922#689226</link>
      <author>rajagiri</author>
      <description>better you can use basic array format.&lt;br&gt;
&lt;br&gt;
[url=&lt;a href=&quot;http://www.repairsharks.com]ipod&quot;&gt;http://www.repairsharks.com]ipod&lt;/a&gt; repair solutions[/url]&lt;br&gt;
&lt;br&gt;
[url=&lt;a href=&quot;http://www.repairsharks.com/apple-ipod-repair]cheap&quot;&gt;http://www.repairsharks.com/apple-ipod-repair]cheap&lt;/a&gt; apple-ipod service[/url]&lt;br&gt;
&lt;br&gt;
[url=&lt;a href=&quot;http://www.repairsharks.com/about.php]xbox&quot;&gt;http://www.repairsharks.com/about.php]xbox&lt;/a&gt; 360 repair[/url]</description>
    </item>
  </channel>
</rss>

