When you change a protocol property, the figure handlers close (by design). This causes the stored sweep in the builtin handlers to disappear. It would be nice if the stored sweeps stuck around until they were explicitly cleared.
Here is the pattern to store info across figure handlers:
classdef Figure < symphonyui.core.FigureHandler
methods
function obj = Figure()
% Get stored info.
averages = obj.storedAverages();
end
function store(obj)
% Store some data.
obj.storedAverages([1 2 3]);
end
end
methods (Static)
function averages = storedAverages(averages)
% This method stores means across figure handlers.
persistent stored;
if nargin > 0
stored = averages;
end
averages = stored;
end
end
end
When you change a protocol property, the figure handlers close (by design). This causes the stored sweep in the builtin handlers to disappear. It would be nice if the stored sweeps stuck around until they were explicitly cleared.
Here is the pattern to store info across figure handlers: