The save command only saves those Matlab variables which are visible in a workspace. It does not, however, cover the global variables which are reported by who('global') but have not been declared as globals in this workspace. Is there a way to save all global variables in a given Matlab session, even if their names are not known a priori?
MATLAB: How to save all global variables
global variablessave workspace
Best Answer