While in a function, I am loading a variable from a .MAT-file and then I try to access that variable. If that variable name is also available as function, I receive an error. As an example:
function pp x.debug = 'abc'; save a.mat -struct x load a.mat whos fprintf('%s\n', debug);end
With this example I receive the following error:
??? Attempt to execute SCRIPT debug as a function: c:\MATLAB\R2010a\toolbox\matlab\codetools\debug.m Error in ==> pp at 7 fprintf('%s\n', debug);
Best Answer