Please read the Getting Started chapters of the documentation. There you find the explanation, that each function has its own workspace - a kind of container for the local variables - to avoid interferences. The command load imports the contents of the file in the current workspace, such that it appears in the base workspace, when it runs in the command windows. But when load is called inside a function, the imported variables are available only there. And this is important and safe.
To reduce confusions and unwanted side-effects it is recommended to store the output of load in a variable:
Then using Data.a shows directly, where the value is comming from. But in:
a = 3.1415;
load(FileName);
disp(a);
Now it is impossible to know the source of the value of a when reading the source code. This makes the debugging much harder.
Best Answer