title: Error:Maximum variable size allowed by the program is exceeded. while using sub2ind
body: <p>Please suggest how to sort out this issue:</p>
  
  <pre><code>nNodes = 50400;
  adj = sparse(nNodes,nNodes);
  
  adj(sub2ind([nNodes nNodes], ind, ind + 1)) = 1; %ind is a vector of indices
  ??? Maximum variable size allowed by the program is exceeded.
  </code></pre>