Hello,
I need to create empty variables in a mat file.
I've tried as follows:
MatFileWriter mfw;
matDataStream = new List<mlarray>();
matDataStream.Add(new MLEmptyArray("a"));
mfw = new MatFileWriter("test.mat",matDataStream,true);</mlarray>
This code generates a System.InvalidCastException when trying to write the file, because it is impossible to cast an object of type 'csmatio.types.MLEmptyArray' to 'csmatio.types.MLNumericArray`1[System.Double]'.
Any suggestions?
Thanks again for your support!
I took a short look into the code and I am not sure what the purpose of the "MLEmptyArray" class really is. csmatio uses it only when creating empty members of Matlab struct and cell variables but not for standalone Matlab variables.
I would suggest that you create empty variables like this:
~~~~:::matlab
MLArray arr = new MLDouble("a", new int[] { 0, 0 });
~~~~
Would that work for you?
Tobias
It seems to me that MLEmptyArray wasn't designed to be used that way so I won't consider that a bug.