title: invalid conversion from 'int' to int* [-fpermissive]
body: <p>Previously I had this implemented and it worked:</p>
  
  <pre><code>int *train_X = (int *)mxGetData(IN_a);// pointer to 6th argument matrix train_X 
  
  for (int i = 0; i &lt; 6; i++)
  {
      for (int j = 0; j &lt; 6; j++)
      {
          cout &lt;&lt; train_X[6 * i + j] &lt;&lt; endl;
      }
  }
  
  int sizeTrain_X1 = mxGetM(IN_a);
  int sizeTrain_X2 = mxGetN(IN_a);
  </code></pre>
  
  <p>I could even manage to check if i get the correct sizes with the following and it was all good. </p>
  
  <pre><code>cout &lt;&lt;"Training input NumOfCollum:\n"&lt;&lt; sizeTrain_X1 &lt;&lt; endl;
  cout &lt;&lt; "Training input NumOfRows:\n"&lt;&lt;sizeTrain_X2 &lt;&lt; endl;
  </code></pre>
  
  <p>but then when trying my entire program with the following initialization i get a compilation error:</p>
  
  <pre><code>for (int epoch = 0; epoch&lt;training_epochs; epoch++)
  {
      for (int i = 0; i&lt;train_S; i++)
      {
          rbm.contrastive_divergence(train_X[i], learning_rate, k);
      }
  }
  </code></pre>
  
  <p>Here is the error message:</p>
  
  <blockquote>
    <p>RBM.cpp: In function ‘void mexFunction(int, mxArray**, int, const
    mxArray**)’:
         RBM.cpp:570:64: error: invalid conversion from ‘int’ to ‘int*’ [-fpermissive]
         RBM.cpp:81:6: error:   initializing argument 1 of ‘void                                RBM::contrastive_divergence(int*, double, int)’ [-fpermissive]
         RBM.cpp:615:32: error: invalid types ‘int[int]’ for array subscript</p>
  </blockquote>