Dear matlab expert, I have these script
myFolder = 'C:\ZTD\Wetz dan Dryz\DryZ\DryZ';
errorMessage = sprintf('Error: The following folder does not exist:\n%s\nPlease specify a new folder.', myFolder);
uiwait(warndlg(errorMessage));
Allfile = fullfile(myFolder, '*.txt');
time_sec2000 = num(1:end,1);
time_days = time_sec2000/86400;
MJD = time_days + mjd20000;
[year, month, day, hour, minute, second] = datevec(MJD + 678942);
YYF = decyear([year, month, day, hour, minute, second]);
newdata = [MJD YYF zwd1 zwd2 zwd3];
writematrix (newdata,sites,'Delimiter','space')
I want my output file have formatspec using fprintf with MJD %15.8f YYF %14.8f and zwd1,zwd2,zwd3 %18.16f and I want to change the output filename to filename_out using writematrix. How can I do it?