<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/169382</link>
    <title>MATLAB Central Newsreader - 3D matrix</title>
    <description>Feed for thread: 3D matrix</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2008 by The 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>The MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Fri, 16 May 2008 10:12:02 -0400</pubDate>
      <title>3D matrix</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/169382#432451</link>
      <author>mark b.</author>
      <description>hi,&lt;br&gt;
i've got three vectors: a,b,c. each of it with length=97.&lt;br&gt;
i need to do a 3d matrix, in which i'll have a,b,c..&lt;br&gt;
i'm sure that is very simple, but i've found some &lt;br&gt;
difficulties:/&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Fri, 16 May 2008 18:11:03 -0400</pubDate>
      <title>Re: 3D matrix</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/169382#432569</link>
      <author>roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)</author>
      <description>In article &amp;lt;g0jmli$ah$1@fred.mathworks.com&amp;gt;,&lt;br&gt;
mark b. &amp;lt;john.doe.nospam@mathworks.com&amp;gt; wrote:&lt;br&gt;
&lt;br&gt;
&amp;gt;i've got three vectors: a,b,c. each of it with length=97.&lt;br&gt;
&amp;gt;i need to do a 3d matrix, in which i'll have a,b,c..&lt;br&gt;
&amp;gt;i'm sure that is very simple, but i've found some &lt;br&gt;
&amp;gt;difficulties:/&lt;br&gt;
&lt;br&gt;
Please explain more clearly what the 3D matrix output should&lt;br&gt;
look like. Based upon what you said, it looks to me to be&lt;br&gt;
more likely that you want the 2D matrix&lt;br&gt;
&lt;br&gt;
output = [a(:);b(:);c(:)]&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
If not then my next best guess would be that you want&lt;br&gt;
&lt;br&gt;
[ta tb tc] = ndgrid(a,b,c);&lt;br&gt;
output = cat(3,ta,tb,tc);&lt;br&gt;
&lt;br&gt;
-- &lt;br&gt;
&amp;nbsp;&amp;nbsp;"We worked every day, Sunday included, until at least ten&lt;br&gt;
&amp;nbsp;&amp;nbsp;o'clock at night. I remember it was an event when we quit work&lt;br&gt;
&amp;nbsp;&amp;nbsp;on Christmas night at eight o'clock to attend a family reunion."&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;-- Walter Davidson (of Harley-Davidson)&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Sat, 17 May 2008 08:02:02 -0400</pubDate>
      <title>Re: 3D matrix</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/169382#432631</link>
      <author>mark b.</author>
      <description>[ta tb tc] = ndgrid(a,b,c);&lt;br&gt;
output = cat(3,ta,tb,tc);&lt;br&gt;
&lt;br&gt;
that is exacly what i want! thank You very much:)&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Sat, 17 May 2008 08:14:01 -0400</pubDate>
      <title>Re: 3D matrix</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/169382#432633</link>
      <author>mark b.</author>
      <description>sorry, i took a look once again and it's not exacly what i &lt;br&gt;
wanted.&lt;br&gt;
consider:&lt;br&gt;
&lt;br&gt;
a=1:5;&lt;br&gt;
b=2:6;&lt;br&gt;
c=3:7;&lt;br&gt;
[ta tb tc] = ndgrid(a,b,c);&lt;br&gt;
output = cat(3,ta,tb,tc);&lt;br&gt;
&lt;br&gt;
then size(output) will be 5x5x15&lt;br&gt;
and i need the matrix to be 5x5x5 (axbxc)&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Sat, 17 May 2008 09:08:03 -0400</pubDate>
      <title>Re: 3D matrix</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/169382#432635</link>
      <author>John D'Errico</author>
      <description>"mark b." &amp;lt;john.doe.nospam@mathworks.com&amp;gt; wrote in message &lt;br&gt;
&amp;lt;g0m449$nsj$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; sorry, i took a look once again and it's not exacly what i &lt;br&gt;
&amp;gt; wanted.&lt;br&gt;
&amp;gt; consider:&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; a=1:5;&lt;br&gt;
&amp;gt; b=2:6;&lt;br&gt;
&amp;gt; c=3:7;&lt;br&gt;
&amp;gt; [ta tb tc] = ndgrid(a,b,c);&lt;br&gt;
&amp;gt; output = cat(3,ta,tb,tc);&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; then size(output) will be 5x5x15&lt;br&gt;
&amp;gt; and i need the matrix to be 5x5x5 (axbxc)&lt;br&gt;
&lt;br&gt;
What matrix? What do you want this matrix&lt;br&gt;
to hold? You have never yet told us this&lt;br&gt;
information, just the size of it.&lt;br&gt;
&lt;br&gt;
zeros(97,97,97)&lt;br&gt;
&lt;br&gt;
will give you an array of the originally&lt;br&gt;
requested size.&lt;br&gt;
&lt;br&gt;
John&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Sat, 17 May 2008 09:27:02 -0400</pubDate>
      <title>Re: 3D matrix</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/169382#432637</link>
      <author>mark b.</author>
      <description>i know i can make make matrix = zeros(97,97,97) and then &lt;br&gt;
i'll have 3d matrix size 97x97x97.&lt;br&gt;
but then i want to put inside of it a,b,c, where each is &lt;br&gt;
the size of 97. so then i'll still have matrix with size&lt;br&gt;
97x97x97 but with a,b and c inside..&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Sat, 17 May 2008 11:45:04 -0400</pubDate>
      <title>Re: 3D matrix</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/169382#432640</link>
      <author>John D'Errico</author>
      <description>"mark b." &amp;lt;john.doe.nospam@mathworks.com&amp;gt; wrote in message &lt;br&gt;
&amp;lt;g0m8d6$so0$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; i know i can make make matrix = zeros(97,97,97) and then &lt;br&gt;
&amp;gt; i'll have 3d matrix size 97x97x97.&lt;br&gt;
&amp;gt; but then i want to put inside of it a,b,c, where each is &lt;br&gt;
&amp;gt; the size of 97. so then i'll still have matrix with size&lt;br&gt;
&amp;gt; 97x97x97 but with a,b and c inside..&lt;br&gt;
&lt;br&gt;
(John takes a quiet moment to pound his&lt;br&gt;
head against a brick wall. While this does&lt;br&gt;
not directly relieve the pain he feels in his&lt;br&gt;
head, it distracts him. It seems better now.)&lt;br&gt;
&lt;br&gt;
But you still have not said what is in this&lt;br&gt;
matrix.&lt;br&gt;
&lt;br&gt;
A simple array  in Matlab is composed of&lt;br&gt;
scalar elements, each of which is a SINGLE&lt;br&gt;
number or character. Those elements may&lt;br&gt;
be the standard double precision numbers,&lt;br&gt;
or they may be singles, uint8s, etc.&lt;br&gt;
&lt;br&gt;
So it makes no sense that you want to put&lt;br&gt;
a, b, and c inside this array. There are other&lt;br&gt;
classes of variables in Matlab, such as cell&lt;br&gt;
arrays or structures. And there are higher&lt;br&gt;
dimensional arrays. Do you perhaps wish to&lt;br&gt;
create a 4 dimensional array?&lt;br&gt;
&lt;br&gt;
So again, what will be inside each element&lt;br&gt;
of this array? Please explain yourself, as my&lt;br&gt;
crystal ball is always foggy at this time of&lt;br&gt;
day.&lt;br&gt;
&lt;br&gt;
John&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Sat, 17 May 2008 14:41:43 -0400</pubDate>
      <title>Re: 3D matrix</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/169382#432659</link>
      <author>Peter Boettcher</author>
      <description>"mark b." &amp;lt;john.doe.nospam@mathworks.com&amp;gt; writes:&lt;br&gt;
&lt;br&gt;
&amp;gt; i know i can make make matrix = zeros(97,97,97) and then &lt;br&gt;
&amp;gt; i'll have 3d matrix size 97x97x97.&lt;br&gt;
&amp;gt; but then i want to put inside of it a,b,c, where each is &lt;br&gt;
&amp;gt; the size of 97. so then i'll still have matrix with size&lt;br&gt;
&amp;gt; 97x97x97 but with a,b and c inside..&lt;br&gt;
&lt;br&gt;
Let's reduce this to 2D, and vectors and matrix with size 4.  So I have&lt;br&gt;
two 4-element vectors: [1 2 3 4] and [5 6 7 8].  I want a 4x4 matrix.&lt;br&gt;
Write out the 4x4 matrix which describes where the above numbers go:&lt;br&gt;
&lt;br&gt;
[? ? ? ?]&lt;br&gt;
[? ? ? ?]&lt;br&gt;
[? ? ? ?]&lt;br&gt;
[? ? ? ?]&lt;br&gt;
&lt;br&gt;
Then explain the extension to 3D.&lt;br&gt;
&lt;br&gt;
-Peter&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Sat, 17 May 2008 16:44:31 -0400</pubDate>
      <title>Re: 3D matrix</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/169382#432664</link>
      <author>Skeptic</author>
      <description>On May 17, 5:27=A0am, "mark b." &amp;lt;john.doe.nos...@mathworks.com&amp;gt; wrote:&lt;br&gt;
&amp;gt; i know i can make make matrix =3D zeros(97,97,97) and then&lt;br&gt;
&amp;gt; i'll have 3d matrix size 97x97x97.&lt;br&gt;
&amp;gt; but then i want to put inside of it a,b,c, where each is&lt;br&gt;
&amp;gt; the size of 97. so then i'll still have matrix with size&lt;br&gt;
&amp;gt; 97x97x97 but with a,b and c inside..&lt;br&gt;
&lt;br&gt;
------------------------------------------&lt;br&gt;
mark b./john doe&lt;br&gt;
So go ahead and do it.  Just stick the 3 vectors in.  You'll have 3&lt;br&gt;
lines of numbers in a mostly empty array.  Go ahead and stick them&lt;br&gt;
anywhere you want - what do I care?  (Others may have their own&lt;br&gt;
suggestions of where you can stick them.)  Sounds like you consider&lt;br&gt;
this as a solution since you've stopped asking questions.&lt;br&gt;
- skeptic&lt;br&gt;
</description>
    </item>
  </channel>
</rss>
