xとyの位置ベクトルから可能なすべての組み合わせを示す表を作成したい2つの位置ベクトル xpos と ypos が与えられています。これらのxとyの位置ベクトルから、すべての可能な組み合わせを示す表を作成したいと考えています。ここでは、すべての可能な組み合わせを含む2つの新しいベクトルを作成するという非常に簡単な例を示します。問題はインデックス付けに起因しているようですが、行き詰まっています。
// Want to create table showing all possible combinations from x & y position vectors
xpos={1, 2, 3, 4, 5};
ypos={7, 8, 9 };
xloc={};
yloc={};
// Loop through x positions
for(i=1, i<=NItems(xpos), i++,
// Loop through y positions
for(j=1, j<=NItems(ypos),j++,
insert into(xloc, xpos);
insert into(yloc, ypos, j);
);
//print(i);
);
xloc;
yloc;
dt = new table("All Combos");
dt << new column("X", continuous, values(xloc));
dt << 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
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
高度な統計モデリングマスカスタマイゼーション品質およびプロセスエンジニアリングRe: x & y 位置ベクトルから可能なすべての組み合わせを示すテーブルを作成したい私はただ使うだろう
テーブル=>結合
デカルト結合機能を使用して、必要なものを取得します。

names default to here(1);
xpos={1, 2, 3, 4, 5};
ypos={7, 8, 9 };
dt1 = new table("One", new column("x"));
dt1:x << set values(xpos);
dt2 = new table("Two", new column("y"));
dt2:y << set values(ypos);
dtCart = dt1 << Join(
With( dt2 ),
Cartesian Join,
Output Table( "Final" )
);Re: x と y の位置ベクトルから可能なすべての組み合わせを示す表を作成したいありがとう! あまりにも忙しくて、あなたの解決策を忘れてしまいました。今日が月曜日だったせいで、忘れてしまったのでしょうか?