title: Reading data of a mat file in visual c++ by MatIO
body: <p>I want to read a mat file in visual C++ by matI/o library. I add <code>#include&lt;matio.h&gt;</code> to headers and add folder of headers to <code>VC++ Directories&gt;include dir</code> . My mat file (opt.mat) has a structure that its field are some matrices. I want to read data of these matrices.
  I write these codes,(opt.mat has a field with name "numsample") But when I check 'matvar' in end of debugging this code , this is empty and its field doesn't any thing . Where is problem?</p>
  
  <p>My codes:</p>
  
  <pre><code>mat_t    *matfp;
  matvar_t *matvar;
  matfp = Mat_Open("opt.mat",MAT_ACC_RDONLY);
  matvar = Mat_VarReadInfo(matfp,"x");
  matvar=Mat_VarGetStructFieldByName(matvar,"numsample",1);
  </code></pre>