<?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: Want to create table showing all possible combinations from x &amp;amp; y position vectors in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Want-to-create-table-showing-all-possible-combinations-from-x/m-p/619588#M81901</link>
    <description>&lt;P&gt;I would just use&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Tables=&amp;gt;Join&lt;/P&gt;
&lt;P&gt;and use the Cartesian Join capabilities to get what you want.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="txnelson_0-1680535169909.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/51693i574784842DB733DA/image-size/medium?v=v2&amp;amp;px=400" role="button" title="txnelson_0-1680535169909.png" alt="txnelson_0-1680535169909.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;names default to here(1);
xpos={1, 2, 3, 4, 5};
ypos={7, 8, 9 };

dt1 = new table("One", new column("x"));
dt1:x &amp;lt;&amp;lt; set values(xpos);
dt2 = new table("Two", new column("y"));
dt2:y &amp;lt;&amp;lt; set values(ypos);

dtCart = dt1 &amp;lt;&amp;lt; Join(
	With( dt2 ),
	Cartesian Join,
	Output Table( "Final" )
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 03 Apr 2023 15:19:52 GMT</pubDate>
    <dc:creator>txnelson</dc:creator>
    <dc:date>2023-04-03T15:19:52Z</dc:date>
    <item>
      <title>Want to create table showing all possible combinations from x &amp; y position vectors</title>
      <link>https://community.jmp.com/t5/Discussions/Want-to-create-table-showing-all-possible-combinations-from-x/m-p/619546#M81899</link>
      <description>&lt;P&gt;I am provided 2 position vectors xpos and ypos.&amp;nbsp; I want to create table showing all possible combinations from the x &amp;amp; y position vectors. I'm showing a very simple example where I want to create 2 new vectors containing all possible combinations. My issue appears to stem from the indexing but I'm stumped.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;// Want to create table showing all possible combinations from x &amp;amp; y position vectors

xpos={1, 2, 3, 4, 5};
ypos={7, 8, 9 };

xloc={};
yloc={};

// Loop through x positions
for(i=1, i&amp;lt;=NItems(xpos), i++,
	// Loop through y positions
	for(j=1, j&amp;lt;=NItems(ypos),j++,
		insert into(xloc, xpos);
		insert into(yloc, ypos, j);
	);	
	//print(i);
);
	
xloc;
yloc;

dt = new table("All Combos");
dt &amp;lt;&amp;lt; new column("X", continuous, values(xloc));
dt &amp;lt;&amp;lt; new column("Y", continuous, values(y));

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	Want a table that looks like this:
	X	Y
	1	7
	1	8
	1	9
	2	7
	2	8
	2	9
	.
	.
	.
	5	7
	5	8
	5	9
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 09 Jun 2023 16:07:14 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Want-to-create-table-showing-all-possible-combinations-from-x/m-p/619546#M81899</guid>
      <dc:creator>Dave0416</dc:creator>
      <dc:date>2023-06-09T16:07:14Z</dc:date>
    </item>
    <item>
      <title>Re: Want to create table showing all possible combinations from x &amp; y position vectors</title>
      <link>https://community.jmp.com/t5/Discussions/Want-to-create-table-showing-all-possible-combinations-from-x/m-p/619588#M81901</link>
      <description>&lt;P&gt;I would just use&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Tables=&amp;gt;Join&lt;/P&gt;
&lt;P&gt;and use the Cartesian Join capabilities to get what you want.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="txnelson_0-1680535169909.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/51693i574784842DB733DA/image-size/medium?v=v2&amp;amp;px=400" role="button" title="txnelson_0-1680535169909.png" alt="txnelson_0-1680535169909.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;names default to here(1);
xpos={1, 2, 3, 4, 5};
ypos={7, 8, 9 };

dt1 = new table("One", new column("x"));
dt1:x &amp;lt;&amp;lt; set values(xpos);
dt2 = new table("Two", new column("y"));
dt2:y &amp;lt;&amp;lt; set values(ypos);

dtCart = dt1 &amp;lt;&amp;lt; Join(
	With( dt2 ),
	Cartesian Join,
	Output Table( "Final" )
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 03 Apr 2023 15:19:52 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Want-to-create-table-showing-all-possible-combinations-from-x/m-p/619588#M81901</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2023-04-03T15:19:52Z</dc:date>
    </item>
    <item>
      <title>Re: Want to create table showing all possible combinations from x &amp; y position vectors</title>
      <link>https://community.jmp.com/t5/Discussions/Want-to-create-table-showing-all-possible-combinations-from-x/m-p/619596#M81904</link>
      <description>&lt;P&gt;Thank you! I got so wrapped around the axle that I forgot about your solution. Can I blame my lapse on today being Monday?&lt;/P&gt;</description>
      <pubDate>Mon, 03 Apr 2023 15:23:48 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Want-to-create-table-showing-all-possible-combinations-from-x/m-p/619596#M81904</guid>
      <dc:creator>Dave0416</dc:creator>
      <dc:date>2023-04-03T15:23:48Z</dc:date>
    </item>
  </channel>
</rss>

