Question: how to export matrix code into text file

LM:=proc(n)
local L;
uses combinat;
L:=permute([1$(n*(n-1)/2), 0$(n*(n-1)/2)], n*(n-1)/2);
[seq(Matrix(n,{seq(seq((i+1,j)=L[k][(i-1)*i/2+j], j=1..i), i=1..n-1)}, shape=symmetric), k=1..nops(L))];
end proc:
M := LM(5);
N := nops(M);
append("E:\\mm.txt");
for i from 1 to N do
ExportMatrix( "E://mm.txt", M[i]);
od:

 

hope to export to a text file

and show

for example

matrix([[1,1,1],[1,1,0],[0,0,0]]);


matrix([[1,1,1],[1,1,0],[0,0,0]]);


matrix([[1,1,1],[1,1,0],[0,0,0]]);

...

etc

 

Please Wait...