MATLAB: How to save results into csv file

addcsvnew columnsave

Hello everyone, I have a csv file (9X15). At the 15th column, I have times and I converted them in seconds. How can I add/save these results (from the command window)into a new column (16th) at the same csv file.? Thank you very much

Best Answer

Stitch the column onto the right side, and then call csvwrite():
m16Cols = [m15Cols, column16]; % Stitch column16 onto existing 15 column matrix.
csvwrite(filename, m16Cols);