if ~exist('A','var') A=[];else A=evalin('base','A');end
This code works great from a script, but not from within the function since it has its own workspace. I do not see an option to check in the base workspace.
baseMATLABvariable
if ~exist('A','var') A=[];else A=evalin('base','A');end
Best Answer