%% Clear Memoized Function Caches
% Create a memoized function object for the sin function, and call it several times.

mf = memoize(@sin);
a = mf(0);
b = mf(pi/2);
c = mf(0);

% View the statistics for the object.

mf.stats.Cache

% Clear the memoized function object cache, and view the statistics.

mf.clearCache
mf.stats.Cache

% Copyright 2012 The MathWorks, Inc.