Hi,
My code follows. Everything is correct except that only the value from the last run of the script is saved in the output file. Please can someone help?
The commands commented out also have been tried and do not work. Please help me…
numfilesx = 2numfilesy = 2OutputFilePath = 'C:\1Feb19 output';OutputFilePhase = 'PhaseDiff.csv';for x = 0:numfilesx for y = 0:numfilesy myfilename = sprintf("C:\\1Feb19_final\\row%d_%d.csv", y, x); PhaseDiff = atan (Y1(1)/Z1(1)); csvwrite(filenamePhase,PhaseDiff,x,y) %dlmwrite(filenamePhase,PhaseDiff,'delimiter',' ','roffset',1)
%filenamePhase = fullfile(OutputFilePath, OutputFilePhase);
%[fid1, msg] = fopen(filenamePhase, 'wt');
%if fid1 < 0
% error('Could not open file "%s" because "%s"', fid1, msg);
%end
%fprintf(fid1, '%s\n', PhaseDiff);
fclose('all'); endend
Best Answer