Instead of writing clc
, close all
, and clear all
at the beginning of every MATLAB code, you can create a script that you can call from other scripts to execute these commands. This way you only need to include it once.
Here's how you can do it:
main.m185 chars7 lines
You can then call this function at the beginning of your other MATLAB scripts or functions to clear the workspace:
main.m45 chars3 lines
By doing this, you won't have to write clc
, close all
, and clear all
at the beginning of every MATLAB code.
gistlibby LogSnag