How do I use writetable to output a filename depending on my input?
Show older comments
For example,
data = input('Input your excel file: ','s');
So, if I am to put my input of '15th of June', I want to get an output of
Table; % assuming I've coded some things based on data and my final product is Table
writetable(Table,'Schedule for 15th of June.xlsx');
But the data input may change and I want the default to be 'Schedule for "data".xlsx'. I can't figure how to do it. I've noticed that the file name has to be purely text.
I've also looked at the possibility of naming the 'Table' as the table;
Schedule_for_15th_of_June;
writetable(Schedule_for_15th_of_June);
But I know that that will only output a file in .txt, while my desired file type is .xlsx. I want to change writetable to make it so the default output is .xlsx but I don't know how to and I'm afraid it'll break the function. I appreciate any of your help in advance.
Accepted Answer
More Answers (0)
Categories
Find more on Spreadsheets in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!