How to use the current date as name for a CSV file

限于喜欢 提交于 2019-12-11 10:19:34

问题


How do I create a csv file with date as the name of the csv file. I tried doing it, but the date won't appear only the name does. The language is Scilab which is similar to Matlab.


回答1:


I do not understand your question fully. But following the csvWrite documentation and the date documentation. You could do someting like this

filename_with_date_string = date() + ".csv";
directory_path = TMPDIR;

// Some matrix you want to save
M = [1:10] * 0.1;     

// Create the file
file = fullfile(directory_path, filename_with_date_string);

// Fill it with your matrix
csvWrite(M, file);


来源:https://stackoverflow.com/questions/22668855/how-to-use-the-current-date-as-name-for-a-csv-file

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!