Error setting 'Prop1' property of 'MyClass' class:
Values must not be sparse.
When you assign a value to the property, MATLAB calls mustBeNonsparse with the value being assigned to the property. mustBeNonsparse issues an error because the value assigned to Prop1 is sparse.
Restrict Function Argument Values
This function restricts the input argument to be any nonsparse value.
function mbNonsparse(S)
arguments
S {mustBeNonsparse}end
disp(S)
end
Calling this function with a sparse array results in an error being thrown by mustBeNonsparse.