<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Converting a Vector into a Matrix in SAS/IML Software and Matrix Computations</title>
    <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Converting-a-Vector-into-a-Matrix/m-p/49100#M290</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use the &lt;A href="http://support.sas.com/documentation/cdl/en/imlug/64248/HTML/default/viewer.htm#imlug_langref_sect269.htm"&gt;SHAPE function&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;A blog article on reshaping matrices is here: &lt;A href="http://blogs.sas.com/content/iml/2010/10/11/how-can-you-reshape-a-matrix/"&gt;http://blogs.sas.com/content/iml/2010/10/11/how-can-you-reshape-a-matrix/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The SHAPE function arranges the elements rowwise, so the first ROW of m contains the first consecutive elements:&lt;/P&gt;&lt;P&gt;v = 1:1000;&lt;/P&gt;&lt;P&gt;w = shape(v, 20, 50); /* w is 20 x 50 */&lt;/P&gt;&lt;P&gt;To get the data in column-wise order, transpose w:&lt;/P&gt;&lt;P&gt;m = T(w); /* m is 50 x 20 */&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rick&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; font-size: 10pt;"&gt;Statistical programming blog: &lt;A href="http://blogs.sas.com/content/iml"&gt;&lt;SPAN style="color: blue;"&gt;http://blogs.sas.com/content/iml&lt;/SPAN&gt;&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 16 Nov 2011 21:36:48 GMT</pubDate>
    <dc:creator>Rick_SAS</dc:creator>
    <dc:date>2011-11-16T21:36:48Z</dc:date>
    <item>
      <title>Converting a Vector into a Matrix</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Converting-a-Vector-into-a-Matrix/m-p/49099#M289</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everyone!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Maybe you could help me with my latest obstacle I've encountered with IML. Do you happen to know how to convert a vector into a matrix?&lt;/P&gt;&lt;P&gt;Here is a little example to give you a better idea:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Given:&lt;/P&gt;&lt;P&gt;Vector n (1000x1)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Goal:&lt;/P&gt;&lt;P&gt;Convert vector n into a 50x20 matrix m. The first column of matrix m should be equal to the first 50 elements of vector n. The second column should be equal to the next 50 elements and so on.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It would be great if you had a solution for this problem... Thanks a million!!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Nov 2011 21:24:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Converting-a-Vector-into-a-Matrix/m-p/49099#M289</guid>
      <dc:creator>MarkGIP</dc:creator>
      <dc:date>2011-11-16T21:24:40Z</dc:date>
    </item>
    <item>
      <title>Converting a Vector into a Matrix</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Converting-a-Vector-into-a-Matrix/m-p/49100#M290</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use the &lt;A href="http://support.sas.com/documentation/cdl/en/imlug/64248/HTML/default/viewer.htm#imlug_langref_sect269.htm"&gt;SHAPE function&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;A blog article on reshaping matrices is here: &lt;A href="http://blogs.sas.com/content/iml/2010/10/11/how-can-you-reshape-a-matrix/"&gt;http://blogs.sas.com/content/iml/2010/10/11/how-can-you-reshape-a-matrix/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The SHAPE function arranges the elements rowwise, so the first ROW of m contains the first consecutive elements:&lt;/P&gt;&lt;P&gt;v = 1:1000;&lt;/P&gt;&lt;P&gt;w = shape(v, 20, 50); /* w is 20 x 50 */&lt;/P&gt;&lt;P&gt;To get the data in column-wise order, transpose w:&lt;/P&gt;&lt;P&gt;m = T(w); /* m is 50 x 20 */&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rick&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; font-size: 10pt;"&gt;Statistical programming blog: &lt;A href="http://blogs.sas.com/content/iml"&gt;&lt;SPAN style="color: blue;"&gt;http://blogs.sas.com/content/iml&lt;/SPAN&gt;&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Nov 2011 21:36:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Converting-a-Vector-into-a-Matrix/m-p/49100#M290</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2011-11-16T21:36:48Z</dc:date>
    </item>
    <item>
      <title>Converting a Vector into a Matrix</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Converting-a-Vector-into-a-Matrix/m-p/49101#M291</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Wow... that went fast! Thank you so much Rick!!! &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Nov 2011 22:24:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Converting-a-Vector-into-a-Matrix/m-p/49101#M291</guid>
      <dc:creator>MarkGIP</dc:creator>
      <dc:date>2011-11-16T22:24:06Z</dc:date>
    </item>
  </channel>
</rss>

