jkriege2 / TinyMAT

C/C++ library to handle writing simple Matlab(r) MAT file
http://jkriege2.github.io/TinyMAT/
GNU Lesser General Public License v2.1
43 stars 22 forks source link

TinyMATWriter_writeStringVector inside of TinyMATWriter_startStruct doesn't work #9

Open HalifaxNick opened 1 year ago

HalifaxNick commented 1 year ago

I'm trying to write a vector of strings to a MATLAB structure using the following pseudo code:

TinyMATWriter_startStruct(...) TinyMATWriter_writeStringVector(...) TinyMATWriter_endStruct(...);

The code compiles and runs fine but when I try to open the resulting .mat file in MATLAB I get the following error: "Cannot read file test.mat"

If I move TinyMATWriter_writeStringVector(...) outside of the structure everything works fine. Any idea what I might be doing wrong?

OliverF2022 commented 3 weeks ago

I encountered the same issue. When calling TinyMATWriter_writeStringVectoror TinyMATWriter_writeStringListin the same way, it results in an unknown empty field being added to the corresponding struct in the generated .mat file.