I have a 20197×44 matrix where the first column is the serial date. I want to change the serial date to the format 'mmm dd, yyyy HH:MM:SS.FFF AM' when I am saving to a text file. (This data is for a client who has requested the date in this format).
I cannot figure out how to do this successfully. I have tried several approaches that are close but not working. I used a code to add column headers (shown below). Would I do something similar but use columns instead of rows?
% SAMPLE 1:
filename = 'Sample 1 Data.txt';fileID = fopen(filename,'w+');[rows, columns] = size(h1);for index = 1:rows fprintf(fileID, '%s,', h1{index,1:end-1}); fprintf(fileID, '%s\n', h1{index,end});end fclose(fileID);dlmwrite(filename, rod1,'-append', 'delimiter', ',');
where h1 is the cell array of the column titles. Any suggestions greatly appreciated. Thank you
– Pamela
Best Answer