<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/173049</link>
    <title>MATLAB Central Newsreader - constructing a 3D array (using permute?)</title>
    <description>Feed for thread: constructing a 3D array (using permute?)</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>Tue, 22 Jul 2008 17:45:06 -0400</pubDate>
      <title>constructing a 3D array (using permute?)</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/173049#444685</link>
      <author>Dave Brackett</author>
      <description>I have some code as follows:&lt;br&gt;
&lt;br&gt;
&amp;nbsp;a=rand(50,16)&lt;br&gt;
&amp;nbsp;b=pi*a.^2&lt;br&gt;
&lt;br&gt;
&amp;nbsp;f=1:100&lt;br&gt;
&amp;nbsp;w=2*pi*f&lt;br&gt;
&lt;br&gt;
&amp;nbsp;c=sqrt((w'.*b)/(pi))&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
This returns an error stating that the matrix dimensions&lt;br&gt;
must agree as would be expected because w' is [100 1] and b&lt;br&gt;
is [50 16].&lt;br&gt;
&lt;br&gt;
My question is, how can I assemble a 3D array of size [100&lt;br&gt;
16 50] to be stored as c, from w' and b? &lt;br&gt;
&lt;br&gt;
I think permute is needed but can't get it to do what I want.&lt;br&gt;
Hopefully you can help. Thanks.</description>
    </item>
    <item>
      <pubDate>Tue, 22 Jul 2008 19:04:03 -0400</pubDate>
      <title>Re: constructing a 3D array (using permute?)</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/173049#444709</link>
      <author>Roger Stafford</author>
      <description>&quot;Dave Brackett&quot; &amp;lt;davebrackett@hotmail.com&amp;gt; wrote in message &amp;lt;g656b2&lt;br&gt;
$4o1$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; I have some code as follows:&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt;  a=rand(50,16)&lt;br&gt;
&amp;gt;  b=pi*a.^2&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt;  f=1:100&lt;br&gt;
&amp;gt;  w=2*pi*f&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt;  c=sqrt((w'.*b)/(pi))&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; This returns an error stating that the matrix dimensions&lt;br&gt;
&amp;gt; must agree as would be expected because w' is [100 1] and b&lt;br&gt;
&amp;gt; is [50 16].&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; My question is, how can I assemble a 3D array of size [100&lt;br&gt;
&amp;gt; 16 50] to be stored as c, from w' and b? &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I think permute is needed but can't get it to do what I want.&lt;br&gt;
&amp;gt; Hopefully you can help. Thanks.&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;I believe you need to first use 'shiftdim' by -1 with b, producing a three-&lt;br&gt;
dimensional array with a first dimension singleton.  Then apply 'bsxfun' with &lt;br&gt;
&quot;@times&quot; using this and w/pi.&lt;br&gt;
&lt;br&gt;
Roger Stafford</description>
    </item>
  </channel>
</rss>

