I'm new to parallel processing in Matlab. I'd like adjust an existing loop with code:
result=[];
load('a.mat','myvar');
for ind=1:100
result(ind)=myvar; %some computationally 'heavy' function
end
While this loop is computing, I would like to pre-fetch the next file called 'b.mat'
. When the loop finishes with the first file, it should check whether the next file is available, and if yes, continue on with the computation.
How can this be achieved? I looked into several tutorials but couldn't find an easy way to achieve this, but was presuming it should be fairly straightforward