How to convert LUA Table to matlab MAT File?
<p>I want to save a LUA table as a MAT file. Structure of Table is as follows:</p>

<pre><code>{
  1 : 
    {
      bounding_box : 
        {
          1 : 0.5
          2 : 0.5
          3 : 704.5
          4 : 1280.5
        }
      PatchName : "03952.jpg"
      confidence : 
        {
          1 : 0.99999818651222
          2 : 1.8134877758073e-06
        }
    }
  2 : 
    {
      bounding_box : 
        {
          1 : 45.5
          2 : 159.5
          3 : 132.5
          4 : 216.5
        }
      PatchName : "03953.jpg"
      confidence : 
        {
          1 : 0.99999864618192
          2 : 1.3538180818906e-06
        }
    }
 }
</code></pre>

<p>Can anybody guide me how to do that ?</p>

<p>I tried matio.save(string of path, table to save) but it returned following error:</p>

<pre><code>bad argument #1 to 'varCreate' (cannot convert 'number' to 'const char *')
stack traceback:
    [C]: in function 'varCreate'
    /home/khurram/torch/install/share/lua/5.1/matio/init.lua:136: in function '__make_var'
    /home/khurram/torch/install/share/lua/5.1/matio/init.lua:78: in function '__make_var'
    /home/khurram/torch/install/share/lua/5.1/matio/init.lua:78: in function '__make_var'
    /home/khurram/torch/install/share/lua/5.1/matio/init.lua:434: in function 'save'
    main.lua:171: in main chunk
    [C]: in function 'dofile'
    [string "_RESULT={dofile('main.lua')}"]:1: in main chunk
    [C]: in function 'xpcall'
    /home/khurram/torch/install/share/lua/5.1/trepl/init.lua:651: in function &lt;/home/khurram/torch/install/share/lua/5.1/trepl/init.lua:560&gt;
    [string "require('trepl')()"]:1: in main chunk  
</code></pre>