MATLAB: How to fill a mtrix in xt file

sarah

I have a matrix of 16384×16384 that I want to save in txt file how to do please?
the code under didn't work :
>> fileID = fopen('vp.txt','wt');
>> fprintf(fileID,'\n',V);
>> fclose(fileID);

Best Answer

fileID = fopen('vp.txt','wt');
fprintf(fileID,'%.15g\n',V);
fclose(fileID);
Note that this will create 268435456 lines of about 17 characters each, for a total of approximately 4.25 gigabytes. You might prefer a different format though. For example would you prefer a comma separated file with 16384 columns per line? Would you prefer engineering notation?