title: Generating random matrix in MATLAB
body: <p>I would like to generate 100 random matrices  <code>A=[a_{ij}]</code> of size 6 by 6 in <code>(0, 9)</code> using matlab programming satisfying the following properties:</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 matlab function <code>rand(6)*9</code>. But, I got wrong matrices. I was wondering if anyone could help me?</p>
  
  <p>Here is my matlab code:</p>
  
  <pre><code>clc; clear;
  n=6;
  m=0;
  for i=1:n
      for j=1:n
          for h=1:n
              while m&lt;100  % generate 100 random matrices
                  A=rand(n)*9;           % random matrix in (0,9)
                  A(i,j)&gt;0;              % positive entries
                  A(i,j)==1/A(j,i);      % multiplicative inverse
                  A(i,h)*A(h,j)==A(i,j); % transitive
                  if i==j &amp;&amp; j==h
                      A(i,j)==1;         % diagonal elements are 1
                  break;
              end
              m=m+1;
              M{m}=A
          end
      end
  end
  end
  M{:}      
  </code></pre>