When any one of the copies is written to the copy that is written to will be fully copied at that point but all the other copies that. I am ending up with a file called filename mat instead of 1 mat 2 mat and 3 mat where 1 2 3 are the id number in the loop. Simply change the save command to load and leave the rest as it is load fullfile tempdir getinet mat sign in to answer this question.