title: How to convert logical sparse matrix into integer sparse matrix in MATLAB?
body: <p>I have a matrix <a href="https://www.cise.ufl.edu/research/sparse/matrices/Hamm/add20.html" rel="nofollow">https://www.cise.ufl.edu/research/sparse/matrices/Hamm/add20.html</a>
  I want to consider it as adjacency matrix of corresponding graph, so I'm replacing every non zero element with 1:</p>
  
  <pre><code>A = A ~- 0
  </code></pre>
  
  <p>Now I want to calculate A*A
  but I can't because</p>
  
  <pre><code>&gt;&gt; A*A    
  Error using *
  Both logical inputs must be scalar.
  To compute elementwise TIMES, use TIMES (.*) instead
  </code></pre>
  
  <p>and I for some reason I cannot just convert logical matrix to integer </p>
  
  <pre><code>&gt;&gt; uint(A)
  Error using numerictype (line 172)
  Invalid arguments (WordLength must be a scalar numeric value).
  
  Error in fixdt (line 186)
          embeddedType = numerictype( varargin{:} );
  
  Error in uint (line 14)
  DataType = fixdt(0,WordLength,0);
  </code></pre>
  
  <p>I could do it by converting matrix to full rank back and forth but this is impractical for my task.</p>