Store the wanted data persistently:
function Out = DataVault(Cmd, Name, Data)
error('Jan:DataValut:BadCmd', 'Unknown command: [%s]', Cmd);
Now call it:
DataVault('store', 'Box1', ValuableData);
ValuableData = DataValut('get', 'Box1')
Of course, clean code would simply omit all clear all calls, because they remove all (unlocked) functions from the memory. You say, that this is not an option. I resist on preferring trustworthy code, which does not contain junk.
If the clear all comes from evil subfunctions, you can either shadow the clear command by defining your own clear function, or if they are scripts, define a variable "all", such that "clear all" clears this variable only. Brrr.