[email protected](obj,s,isInUse);
end
end
Complete Class Definition Files with Save and Load
The Counter class definition file sets up an object with a count property. This counter is
used in the MySaveLoader class definition file to count the number of child objects.
classdef Counter < matlab.System
properties(DiscreteState)
Count
end
methods (Access=protected)
function setupImpl(obj, ~)
obj.Count = 0;
end
function y = stepImpl(obj, u)
if u > 0
obj.Count = obj.Count + 1;
end
y = obj.Count;
end
end
end
classdef MySaveLoader < matlab.System
properties (Access = private)
child
pdependentprop = 1
end
properties (Access = protected)
protectedprop = rand;
end
properties (DiscreteState = true)
state
end
properties (Dependent)
dependentprop
end
Save and Load System Object