I unfortunately cannot share the code, because it's confidential. I have tried to create a MWE, but it appears not to recreate the issue, which confuses me even more. I'm using MATLAB R2017b.
I have a class definition with a property that has as default value an empty cell, {}, which is more specifically a 0x0 empty cell array. The class has a reset method that simply resets the property value to the empty cell {}. However, if I create an object of the class and reset the object, the property value is set to the empty cell, good, but more specifically a 0×1 empty cell array, not good. If I now run unit testing functions, it tests whether two class objects are equal after one is reset, which is not true because isequal({}, cell(0,1)) returns false. This is the real problem. Also, it displays the value as {0×1 cell} instead of just {} which is plainly annoying.
As I said, I cannot recreate the issue in a MWE. I have tried searching MATLAB Answers, found nothing.
EDIT: I will still include the MWE so it's clear exactly what the workflow would be. Imagine the class definition is as follows:
classdef MyClass < handle
properties
Property1 = {};
end
methods
function obj = MyClass
end
function reset(obj)
obj.Property1 = {};
end
end
end
Then, I would run the code
obj = MyClass;
obj
obj.reset
obj
Then the output on the command window would be
obj =
MyClass with properties:
Property1: {}
obj =
MyClass with properties:
Property1: {0x1 cell}