%% Clear All Memoized Function Caches
% Create two memoized functions, and call them several times.

mf1 = memoize(@sin);
mf2 = memoize(@cos);

a = [mf1(0) mf1(pi/2) mf1(pi)];
b = mf2(pi/2);

% View the statistics for the memoized function objects.

mf1.stats.Cache
mf2.stats.Cache

% Clear all memoized function caches, and view the statistics again.

clearAllMemoizedCaches
mf1.stats.Cache
mf2.stats.Cache

% Copyright 2012 The MathWorks, Inc.