writematrix is not creating a new .csv file for writing matrix to if it does not already exist.
7 views (last 30 days)
Image Analyst on 22 May 2022
Show the code where you're creating the folder name and the full file name. You seem to have forgotten to upload it. It should look something like
folder = 'c:\whatever'
% Create folder if it doesn't exist. Maybe writematrix does this for you
% -- I'm not sure because you're saying it doesn't, so I'm doing it manually here.
baseFileName = 'My Data.csv';
fullFilename = fullfile(folder, baseFileName);
% Delete any existing file with the same name.
Waiting for your reply, after you read this link of course:
Image Analyst on 23 May 2022
If you're doing something like
date_str = datestr(now)
that won't work because it has colons in the string and you can't have colons in the filename anywhere except in the second position to separate the drive letter from the folder. To fix, get rid of the colons:
rfile_1 = strrep(rfile_1, ':', '') % Get rid of colons.