Create N handle objects, store 1-3 references to each.
Order of object creation, number of references, and configuration of references all have drastic impact on "clear" time as function of number of objects. Times range from flat, to linear, to quadratic.
Using a simple handle class:
% % classdef simpleHandle < handle
% % properties
% % ref1;
% % ref2;
% % end
% % methods
% % function self = simpleHandel
% % end
% % end
% % end
Benjamin Heasly (2021). Benchmark clear() behavior with OOP handle (https://www.mathworks.com/matlabcentral/fileexchange/23132-benchmark-clear-behavior-with-oop-handle), MATLAB Central File Exchange. Retrieved .
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Create scripts with code, output, and formatted text in a single executable document.
Check out my lastest framework for benchmark functions using python (numpy).
https://github.com/thieunguyen5991/opfunu