Explanation

clear all should not be used to clear only workspace variables. In addition to clearing workspace variables, it also clears functions and scripts. Using clear all causes MATLAB to recompile previously cached code, and can decrease performance.


Suggested Action

When possible, replace instances of clear all in your code.

For more information, see clear and clearvars.