<?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 Re: dynamically define a matrix in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/dynamically-define-a-matrix/m-p/7847#M7841</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use Matrix() instead of [ ] when defining a matrix with a variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;ld_targets &lt;SPAN style="color: #150097;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: #2600eb;"&gt;matrix&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;&lt;SPAN style="color: #009694;"&gt;&lt;STRONG&gt;3&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #150097;"&gt;,&lt;/SPAN&gt; i_ncols&lt;STRONG&gt;)&lt;/STRONG&gt;&lt;SPAN style="color: #150097;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 11 Dec 2013 22:24:32 GMT</pubDate>
    <dc:creator>ms</dc:creator>
    <dc:date>2013-12-11T22:24:32Z</dc:date>
    <item>
      <title>dynamically define a matrix</title>
      <link>https://community.jmp.com/t5/Discussions/dynamically-define-a-matrix/m-p/7846#M7840</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am using JSL to stack some data. The columns have Spec Limit properties so I am using JSL to manually stack those values in a matrix to add to the data as well. The problem is I can not seem to assign values to a matrix without defining it. And I can not dynamically define a matrix. Perhaps I am missing something or there are other matrix tricks someone can suggest.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;dt0 is the table from which I am operating&lt;/P&gt;&lt;P&gt;i_ncols is determined from the number of rows in another table.&lt;/P&gt;&lt;P&gt;ls_colnames is the list of column names that I want to stack and is generated using another table&lt;/P&gt;&lt;P&gt;ld_targets is the final matrix I wish to generate with this loop&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//get targets from column properties&lt;/P&gt;&lt;P&gt;ld_targets = [](3, i_ncols); &lt;/P&gt;&lt;P&gt;For( i = 1, i &amp;lt;= i_ncols, i++,&lt;/P&gt;&lt;P&gt;&amp;nbsp; For( j = 0, j &amp;lt;= 2, j++,&lt;/P&gt;&lt;P&gt;&amp;nbsp; ld_specs = Column( dt0, ls_colnames[i_ncols * j + i] ) &amp;lt;&amp;lt; Get Property( "Spec Limits" );&lt;/P&gt;&lt;P&gt;&amp;nbsp; ld_targets[j + 1, i] = ld_specs["Target"];&lt;/P&gt;&lt;P&gt;&amp;nbsp; )&lt;/P&gt;&lt;P&gt;);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this results in a compile error "expected integer for number of columns" and will not even run.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if I do not define the matrix (comment out the first line) I get the runtime error "Nothing to set in access or evaluation of 'Assign' , ld_targets[j + 1, i] = ld_specs["Target"]"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any suggestions?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks in advance&lt;/P&gt;&lt;P&gt;Heather&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Dec 2013 17:39:05 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/dynamically-define-a-matrix/m-p/7846#M7840</guid>
      <dc:creator>h_lazar</dc:creator>
      <dc:date>2013-12-11T17:39:05Z</dc:date>
    </item>
    <item>
      <title>Re: dynamically define a matrix</title>
      <link>https://community.jmp.com/t5/Discussions/dynamically-define-a-matrix/m-p/7847#M7841</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use Matrix() instead of [ ] when defining a matrix with a variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;ld_targets &lt;SPAN style="color: #150097;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: #2600eb;"&gt;matrix&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;&lt;SPAN style="color: #009694;"&gt;&lt;STRONG&gt;3&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #150097;"&gt;,&lt;/SPAN&gt; i_ncols&lt;STRONG&gt;)&lt;/STRONG&gt;&lt;SPAN style="color: #150097;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Dec 2013 22:24:32 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/dynamically-define-a-matrix/m-p/7847#M7841</guid>
      <dc:creator>ms</dc:creator>
      <dc:date>2013-12-11T22:24:32Z</dc:date>
    </item>
    <item>
      <title>Re: dynamically define a matrix</title>
      <link>https://community.jmp.com/t5/Discussions/dynamically-define-a-matrix/m-p/7848#M7842</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Wow, that was really easy. Why isn't this more clear in the Scripting Guide?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I have to figure out how to put this matrix in a table. Look for a new post on that question.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;H&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Dec 2013 15:51:44 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/dynamically-define-a-matrix/m-p/7848#M7842</guid>
      <dc:creator>h_lazar</dc:creator>
      <dc:date>2013-12-12T15:51:44Z</dc:date>
    </item>
  </channel>
</rss>

