<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/156252</link>
    <title>MATLAB Central Newsreader - big arrays with variable dimension sizes</title>
    <description>Feed for thread: big arrays with variable dimension sizes</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>Sun, 16 Sep 2007 20:04:14 -0400</pubDate>
      <title>big arrays with variable dimension sizes</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/156252#392554</link>
      <author>David Doria</author>
      <description>I have a 4d array where sometimes dimension 3 is length 10&lt;br&gt;
and sometimes dimension 3 is length 200.&lt;br&gt;
&lt;br&gt;
When I do something like this:&lt;br&gt;
&lt;br&gt;
Normalized_Moment_Values(1, 1, :, :), I usually do&lt;br&gt;
squeeze(Normalized_Moment_Values(1, 1, :, :)) to give a&lt;br&gt;
civilized looking result.  However, in this case, i get&lt;br&gt;
something that is LEN x 200, and if it happens to be a time&lt;br&gt;
when it is only length 10, i get 190 rows of 0's.  Is there&lt;br&gt;
a better way to do this (to remove the 0's or even to store&lt;br&gt;
the whole thing so that it doesn't fill the rest with 0's?)?&lt;br&gt;
&lt;br&gt;
Thanks!!&lt;br&gt;
&lt;br&gt;
David</description>
    </item>
    <item>
      <pubDate>Mon, 17 Sep 2007 12:43:29 -0400</pubDate>
      <title>Re: big arrays with variable dimension sizes</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/156252#392651</link>
      <author>David Doria</author>
      <description>Is there no way to do this??&lt;br&gt;
&lt;br&gt;
&quot;David Doria&quot; &amp;lt;daviddoria@gmail.com&amp;gt; wrote in message&lt;br&gt;
&amp;lt;fck27u$88o$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; I have a 4d array where sometimes dimension 3 is length 10&lt;br&gt;
&amp;gt; and sometimes dimension 3 is length 200.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; When I do something like this:&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Normalized_Moment_Values(1, 1, :, :), I usually do&lt;br&gt;
&amp;gt; squeeze(Normalized_Moment_Values(1, 1, :, :)) to give a&lt;br&gt;
&amp;gt; civilized looking result.  However, in this case, i get&lt;br&gt;
&amp;gt; something that is LEN x 200, and if it happens to be a time&lt;br&gt;
&amp;gt; when it is only length 10, i get 190 rows of 0's.  Is there&lt;br&gt;
&amp;gt; a better way to do this (to remove the 0's or even to store&lt;br&gt;
&amp;gt; the whole thing so that it doesn't fill the rest with 0's?)?&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Thanks!!&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; David</description>
    </item>
    <item>
      <pubDate>Mon, 17 Sep 2007 13:48:08 -0400</pubDate>
      <title>Re: big arrays with variable dimension sizes</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/156252#392662</link>
      <author>Simon Preston</author>
      <description>&quot;David Doria&quot; &amp;lt;daviddoria@gmail.com&amp;gt; wrote in message&lt;br&gt;
&amp;lt;fclsph$509$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; Is there no way to do this??&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &quot;David Doria&quot; &amp;lt;daviddoria@gmail.com&amp;gt; wrote in message&lt;br&gt;
&amp;gt; &amp;lt;fck27u$88o$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; I have a 4d array where sometimes dimension 3 is length 10&lt;br&gt;
&amp;gt; &amp;gt; and sometimes dimension 3 is length 200.&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; When I do something like this:&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; Normalized_Moment_Values(1, 1, :, :), I usually do&lt;br&gt;
&amp;gt; &amp;gt; squeeze(Normalized_Moment_Values(1, 1, :, :)) to give a&lt;br&gt;
&amp;gt; &amp;gt; civilized looking result.  However, in this case, i get&lt;br&gt;
&amp;gt; &amp;gt; something that is LEN x 200, and if it happens to be a time&lt;br&gt;
&amp;gt; &amp;gt; when it is only length 10, i get 190 rows of 0's.  Is there&lt;br&gt;
&amp;gt; &amp;gt; a better way to do this (to remove the 0's or even to store&lt;br&gt;
&amp;gt; &amp;gt; the whole thing so that it doesn't fill the rest with 0's?)?&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; Thanks!!&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; David&lt;br&gt;
&amp;gt; &lt;br&gt;
&lt;br&gt;
You mean you want to store variable-length vectors in the&lt;br&gt;
same array?  A cell array will do this, see:&lt;br&gt;
&lt;br&gt;
&lt;a href=&quot;http://blogs.mathworks.com/loren/category/cell-arrays/&quot;&gt;http://blogs.mathworks.com/loren/category/cell-arrays/&lt;/a&gt;&lt;br&gt;
&lt;br&gt;
You can strip zeros using a logical argument, e.g. for&lt;br&gt;
a = cat(1,rand(4,1),zeros(10,1))&lt;br&gt;
then&lt;br&gt;
a = a(a~=0)&lt;br&gt;
&lt;br&gt;
Best wishes, S</description>
    </item>
    <item>
      <pubDate>Mon, 17 Sep 2007 13:49:29 -0400</pubDate>
      <title>Re: big arrays with variable dimension sizes</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/156252#392664</link>
      <author> Randy Poe</author>
      <description>On Sep 16, 4:04 pm, &quot;David Doria&quot; &amp;lt;daviddo...@gmail.com&amp;gt; wrote:&lt;br&gt;
&amp;gt; I have a 4d array where sometimes dimension 3 is length 10&lt;br&gt;
&amp;gt; and sometimes dimension 3 is length 200.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; When I do something like this:&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Normalized_Moment_Values(1, 1, :, :), I usually do&lt;br&gt;
&amp;gt; squeeze(Normalized_Moment_Values(1, 1, :, :)) to give a&lt;br&gt;
&amp;gt; civilized looking result.  However, in this case, i get&lt;br&gt;
&amp;gt; something that is LEN x 200, and if it happens to be a time&lt;br&gt;
&amp;gt; when it is only length 10, i get 190 rows of 0's.  Is there&lt;br&gt;
&amp;gt; a better way to do this (to remove the 0's or even to store&lt;br&gt;
&amp;gt; the whole thing so that it doesn't fill the rest with 0's?)?&lt;br&gt;
&lt;br&gt;
I'm not clear if you're trying to fix a display problem&lt;br&gt;
or a storage problem, but perhaps you want to look&lt;br&gt;
into cell arrays, which can have elements of arbitrary&lt;br&gt;
length (in fact, of arbitrary dimension or type).&lt;br&gt;
&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;&amp;nbsp;- Randy</description>
    </item>
  </channel>
</rss>

