I hope some one can be helpful as I have been struggling with this problem for a while now.
I have huge datafiles (3-4 GB), that I want to read in and save part of in new and smaller files.
When I run the code below it will eventually run out of memory, but for each run in the while loop the matrices G1 and MAT will be reassigned? Or am I missing something obvious? Another problem is that, the files that I manage to save before the computer runs out of memory, is not separated by N - it is only shifted 4 lines so 4 new lines are added in each new saved file.
I really hope someone can be helpful! Thanks for your time.
Best regards Jesper
G1 = textscan(fid,formatSpec,N,'HeaderLines','8','Delimiter',' ');
MAT=cell2mat(G1(:,[6 8 10 11 13 15 17 18 19 20 21 22 23 24 25]));
sti1 = ['C:\Data\Youngsund\Dat files\' name '-' k_str '_new.dat'];