I am trying to save data to files, i.e. txt file. The speed is very low. This step takes almost 80% time over my whole script. My computer has many cores. Could I use them, i.e. parallel way, to help to accelerate the speed in Matlab? I don't know much about know this. May it is impossible. Please just tell me some idea or suggestion about it? Thank you very much.
(edited as Rik suggested)
My code uses fprintf function in a big loop. This is the most time consuming step.
i.e. I need to save a large matrix a, which is 4000000*4
p = fopen(filename,'w');
fprintf(fp,'%d %d %d %d\n',a(i,1),a(i,2),a(i,3),a(i,4));
Is there any method to accelerate it?