title: access sub-matrix of a multidimensional Mat in OpenCV
body: <p>according to this 
  <a href="https://stackoverflow.com/questions/8809517/multi-dimensional-data-in-a-matrix-in-opencv-with-c">post</a> and from OpenCV documentation, I can initialize and access each element of a multidimensional Mat. </p>
  
  <p>Actually, I firstly coded in MATLAB and now need to convert to OpenCV. MATLAB matrix supports sub-matrix access like: a(:,:,3) or b(:,:,3:5)</p>
  
  <p>Can this be done in OpenCV? as far as I know, this can be done with 2D Mat. How about more that 2D??</p>
  
  <p>Edit01: 
  moreover, with multidimensional Mat, the properties cols and rows are not enough to characterize 3 sizes of the matrix. There are cases with dimension larger than 3. How to store these properties?</p>
  
  <p>Edit02:</p>
  
  <pre><code>// create a 100x100x100 8-bit array
  int sz[] = {100, 100, 100};
  Mat bigCube(3, sz, CV_8U, Scalar::all(0));
  </code></pre>
  
  <p>I give up the idea of sub-matrix access with OpenCV Mat. Perhaps, it's not supported in OpenCV. But from this sample code, the constructor receives the 3rd dimension from 'sz'. Which property of Mat this 3rd dimension is passed to? probably in this case, rows = 100, cols = 100, the other ?? = 100
  I'm lost with OPenCV documentation</p>
  
  <p>Edit03: tracking Mat class from OpenCV source
  I've found the definition of the constructor in Edit02 from mat.hpp:</p>
  
  <pre><code>inline Mat::Mat(int _dims, const int* _sz, int _type, const Scalar&amp; _s)
      : flags(0), dims(0), rows(0), cols(0), data(0), refcount(0),
      datastart(0), dataend(0), datalimit(0), allocator(0), size(&amp;rows)
  {
      create(_dims, _sz, _type);
      *this = _s;
  }  
  </code></pre>
  
  <p>the next question is where and how "create" function here is defined?
  => tracing this Mat definition in OpenCV probably helps me to modify/customize my own features in Mat matrix</p>
  
  <p>PS: excuse me if my post is written too messy!! I'm a novic programmer, trying to solve my programming problem. Plz feel free to correct me if my approach is not good or right enough. Thank you!!</p>