<

Question: How to create a nice looking array, table, or matrix?

I'm trying to print a nice looking array (6 columns with various numbers of rows) from an array that storing the data with 5 indices.  Here's the code:

P[i,j,p,q,k]:=(W[1,i].W[1,j].W[1,p].W[1,q]=W[1,k]);

I can print P as a table, but I want it to print with i for the columns 1..6 and the column can just fill up with the entries.  Here's more of the code in case you need it to see what I'm trying to do:


for i from 1 to 6 do
         for j from 1 to 6 do
              for p from 1 to 6 do
                  for q from 1 to 6 do
                      for k from 1 to 7 do
                           tempN:=N[i,j,p,q];
                           tempM:=M[1,k];
                           
                             
                           if (verify(evalm(tempN),evalm(tempM),'matrix')) then
                               elems:=elems+1;
                               print(elems,W[1,i].W[1,j].W[1,p].W[1,q]=W[1,k]);
                               
                               P[i,j,p,q,k]:=(W[1,i].W[1,j].W[1,p].W[1,q]=W[1,k]);
                               #Q[modp((i*6^4+j*6^3+p*36+q*6+k),10),i]:=P[i,j,p,q,k]; (my attempt here failed)
                           end if;
                           if (verify(evalm(tempN),evalm((-1)*evalm(tempM)),'matrix')) then
                               elems:=elems+1;
                               print(elems,W[1,i].W[1,j].W[1,p].W[1,q]=V[1,k]);
                               P[i,j,p,q,k]:=(W[1,i].W[1,j].W[1,p].W[1,q]=V[1,k]);
                               #Q[modp((i*6^4+j*6^3+p*36+q*6+k),10),i]:=P[i,j,p,q,k];
                           else
                               next;
                               break;
                           end if;
                      end do;
                  end do;
              end do;

     end do;

Also, just some values are selected (for example j might not = 5).

I hope someone can help, this is my first post, I'm not a great programmer just a lowly mathematician...



 

Please Wait...