RosettaCodeData/Task/Kronecker-product/Maxima/kronecker-product-2.maxima
2023-09-01 09:35:06 -07:00

8 lines
299 B
Text

altern_kronecker(MatA,MatB):=block(auxlength:length(first(args(MatA))),
makelist(i*args(MatB),i,flatten(args(MatA))),
makelist(apply(matrix,%%[i]),i,1,length(%%)),
lst_equally_subdivided(%%,auxlength),
makelist(apply(addcol,%%[i]),i,1,length(%%)),
map(args,%%),
apply(append,%%),
apply(matrix,%%));