I created a MATLAB structure in my C++ program that calls a shared library created with MATLAB Compiler. In C++, I create the structure using the following code:
int dims[2] = {1,1}; const char* fields[] = {"combinations"}; mwArray Input_struct(2, dims, 1,fields); mwArray comb_struct; Input_struct.Get("combinations",2, 1, 1).Set(comb_struct);
I attempt to save this structure to a MAT-file after passing it to the MATLAB DLL. The structure is not saved and I receive the warning
Warning: Variable 'x' of class 'struct' cannot be saved to a MAT-file or contains nonsaveable members. Skipping...
However, if I print out information about all the members of x before attempting to save the variable, they all appear to be fine.
Best Answer