I have a MATLAB function that needs access to the data of some largeFile.mat. If (to avoid polluting the global namespace) I put the load command within the function, will MATLAB reload largeFile every time the function is called, or is it smart enough to cache largeFile between calls? E.g.
function hello()
load largeFile.mat;
display('hi');
end
for i=1:1000
hello();
end
Should I keep the load command within the function, or should I do it once and pass the largeFile's data in as an arg? Thanks!