Question: Generating matrices

I have to generate a set of antihermitian matrices and the entries the non-zero entries have to be randomly generated. i can generate one antihermitian matrix. but now i want to generate many of them and store them in an array.

my code is:

>with(stats):
>with(stats[random]):
>with(Linear Algebra):
>M:=2:
>N:=2:
>sigma:=1:
>set:=Array(1..M):
   for k from 1 to M do
    for i from 1 to N do
     for j from N+1 to 2*N do
       A[i,j]:=random[normald[0,sigma]](1,'default','inverse')
     end do:
    end do:
    for i from N+1 to 2*N do
      for j from 1 to N do
        A[i,j]:=-conjugate(A[j,i]):
      end do:
    end do:
    set[k]:=A:
   end do:

 

only problem is every matrix in "set" is exactly identical and i want them all to be random and different. any ideas on how to sort this? thanks.

 

 

Please Wait...