Hello everyone,
In my code I have a huge for loop that runs several times for different text files that contain data. Each time the code runs I am able to extract a bunch of information and in the end I put the information that I want in a structure. The name of the structure is dependent of the ID of the text file.
So here is my problem, a bunch of variables in my work space are not needed after the structure is build. So how to I clear everything but the structures?
I can't use 'clearvars -except' because the name of the structure is dependent in the text file ID and there is no specific pattern to follow.
I am hoping clearing things from my work space would allow my code to run faster and solve the out of memory error I get in matlab.
Thank You,
M
Best Answer