classdef Model < handle
%MODEL Application data model.
properties ( SetAccess = private )
% Application data.
Data(:, 1) double = double.empty( 0, 1 )
end
events ( NotifyAccess = private )
% Event broadcast when the data is changed.
DataChanged
end
methods
function random( obj )
%RANDOM Generate new application data.
% Generate column vector of random data.
obj.Data = randn( 20, 1 );
notify( obj, "DataChanged" )
end
function reset( obj )
%RESET Restore the application data to its default value.
% Reset the data to an empty column vector.
obj.Data = double.empty( 0, 1 );
notify( obj, "DataChanged" )
end
end
end