Hi,
When I use this code I get at the end all my results on the same line in my final text file. This is obviously not what I expected. But I cannot solve this problem. If I add more %f, the code doesn't write anything in the text file and if I replace \n by \r it writes all the results on the same column, which is the same problem at the end (I also tried different combinations with \n and \r, I always get the same result). The matrix C is a matrix with 5 columns and 1 line and is replaced at every iteration by an other matrix C with different values. The new values are supposed to be written in the text file, on an other line, etc..
while goA=inputSingleScan(s);v = [toc i];C = horzcat(A,v);Fid=fopen('results.txt','a');fprintf(Fid,'%f\n',C);clear A v Ci=i+1;end
Thank you very much
Best Answer