MATLAB: Memory during a loop

loopmemorypoofing

Hi,
If I run Clear All during a loop, will it also clear the loop value?
Thanks,

Best Answer

As usual I mention, that clear all removes all loaded functions from the memory and reloading them from the disk and parsing them wastes a lot of time. When you want to clear variables, use
clear variables
However, Arthur's hint to use S=load() is very good. 1. it is easy to clear, 2. you cannot overwrite local variables by accident (as e.g. the loop counter...), 3. The debugging is much easier, because you can see on first sight, that "S.abcde" comes from the loaded file, and 4. Matlab is much faster with fixed names of variables compared to the ones created dynamically by EVAL or LOAD without catching the output.