It is the nature of scripts that this happens in every case. The variables created in the first script are written to the workspace (the currently active "container" for variables) and another script, which is called later can access them directly.
Now you can call the scripts from the command line, another script or from a function:
Because the workspace is polluted by variables as soon as the scripts get more powerful, functions are smarter:
function v = funca
v = 2:17;
function funcb(v)
disp(v * 2);
Now this is called from the command line, a script or from inside another function by:
Best Answer