Is there a way to declare global variables in MATLAB?
Please don\'t respond with:
global x y z;
Because I can also read the help fi
You need to declare x as a global variable in every scope (i.e. function/workspace) that you want it to be shared across. So, you need to write test1 as:
x
test1
function test1() global x; x = 5; end