다양한 길이의 행렬을 평평하게하는 더 빠르고 더 나은 방법 제안모든,
이 작업을 수행하는 방법을 알고 있지만 가장 효율적인 방법이라고 생각하지 않습니다. 더 효율적으로 만들 생각 이라니?
Matrix1 = [1,2,3,4,5];
Matrix2 = [2,3,5];
Matrix3 = [7,8,9,10];
ColAVals = {};
ColBVals = {};
ColCVals = {};
for(i = 1, i <= N rows(Matrix1), i++,
for(r = 1, r <= N rows(Matrix2), r++,
for(s = 1, s <= N rows(Matrix3), s++,
Insert Into(ColAVals,Matrix1[i]);
Insert Into(ColBVals,Matrix2[r]);
Insert Into(ColCVals,Matrix3[s]);
);
);
);
Show(ColAVals);
Show(ColBVals);
Show(ColCVals);
dt = New Table("Test");
dt << New Column("A",Numeric,Continuous, << set Values(ColAVals))
<< New Column("B",Numeric,Continuous, << set Values(ColBVals))
<< New Column("C",Numeric,Continuous, << set Values(ColCVals));제목 : Re : 매트릭스의 다양한 길이를 평평하게하는 더 빠르고 좋은 방법을 제안이 방법은 비교적 빠른 것 같습니다.
nmat = 15;
matrices = {};
For( i = 1, i <= nmat, i++,
matrices[i] = J( Random Integer( 5 ), 1, Random Uniform() )
);
start = Tick Seconds();
m1 = As Table( matrices[1] );
m2 = As Table( matrices[2] );
dt = m1 << Join( With( m2 ), Cartesian Join, private );
Close( m1, nosave );
Close( m2, nosave );
For( i = 3, i < N Items( matrices ), i++,
mi = As Table( matrices[i] );
dt = dt << Join( With( mi ), Cartesian Join, private );
Close( mi, nosave );
);
mlast = As Table( matrices[N Items( matrices )] );
dt = dt << Join( With( mlast ), Cartesian Join );
Close( mlast, nosave );
end = Tick Seconds();
total = end - start;
Show( total );
그건 그렇고, 데카르트 조인에주의하십시오. 
제목 : Re : 매트릭스의 다양한 길이를 평평하게하는 더 빠르고 좋은 방법을 제안따라서 모든 행렬의 데카르트 조인을 원하십니까?
다시 말하지만, 타이밍 테스트를 수행하지는 않았지만이 문제는 무엇입니까?
Matrix1 = [1, 2, 3, 4, 5];
Matrix2 = [2, 3, 5];
Matrix3 = [7, 8, 9, 10];
dts = {};
dts[1] = As Table( matrix1 );
dts[2] = As Table( matrix2 );
dts[3] = As Table( matrix3 );
dt = dts[1] << Join( With( dts[2] ), Cartesian Join );
For( i = 3, i <= N Items( dts ), i++,
dt = dt << Join( With( dts[i] ), Cartesian Join );
);제목 : Re : 매트릭스의 다양한 길이를 평평하게하는 더 빠르고 좋은 방법을 제안 @ 제프 _ 퍼킨슨 ,
데이터 테이블로 변환하는 것이 아니라 루핑이 걱정됩니다. 또한 결과 테이블에 다음과 같은 가능한 모든 조합이 있어야합니다.

제목 : Re : 매트릭스의 다양한 길이를 평평하게하는 더 빠르고 좋은 방법을 제안타이밍 테스트를 수행하지 않았지만 As Table ()을 사용하면이 속도가 빨라질 수 있습니다.
matrix1 = [1,2,3,4,5];
matrix2 = [2,3,5];
matrix3 = [7,8,9,10];
maxrows=maximum(nrow(matrix1), nrow(matrix2), nrow(matrix3));
matrix1 = matrix1 |/ j(maxrows-nrow(matrix1), 1, .);
matrix2 = matrix2 |/ j(maxrows-nrow(matrix2), 1, .);
matrix3 = matrix3 |/ j(maxrows-nrow(matrix3), 1, .);
mat=matrix1 || matrix2 || matrix3;
dt=as table(mat);