title: random matrices 2
body: <p>I would like to generate <code>100</code> <code>random</code> square <code>6x6</code> matrices <code>A=[a_{ij}]</code>  with <code>Gaussian noise</code> (modification with standard deviation 0.5) satisfying the following characteristics:</p>
  
  <pre><code> 1. multiplicative inverse: i.e., a_{ij}=1/a_{ji} for all i,j=1,2,...,6.
   2. all entries are positive: i.e., a_{ij}&gt;0 for all i,j=1,2,...,6.
   3. all diagonal elements are 1: i.e, a_{ii}=1 for all i=1,2,..,6.
   4. transitive: i.e., a_{ih}*a_{hj}=a_{ij} for all i,j,h=1,2,...,6.
  </code></pre>
  
  <p>So far, I tried to use a <code>matlab</code> function <code>randn(6)*0.5</code>. But, I got wrong matrices. I was wondering if anyone could help me?</p>
  
  <p>Here is my <code>matlab</code> code:</p>
  
  <pre><code>clc;clear;
  n=6;
  m=0;
  A=randn(n)*0.5; % random matrix with guassian noise
  for i=1:n
      for j=1:n
       for h=1:n
           while m&lt;100  % generate 100 random matrices
               m=m+1;
               A=randn(n)*0.5;   % random matrix with guassian noise \sigma=0.5
  
               A(i,j)&gt;0
                  A(i,j)==1/A(j,i);
                  A(i,h)*A(h,j)==A(i,j)
               if i==j &amp;&amp; j==h
                   A(i,j)==1;
               end
           end
       end
      end
  end
   A       
  </code></pre>