GUI edit excel file name

11 ビュー (過去 30 日間)
Jomei
Jomei 2020 年 4 月 6 日
コメント済み: Jomei 2020 年 4 月 6 日
Hi,
Now I set my excel name is 'filename1'. How can I use the edit box to change the file name, so the user can store the name whatever they want?
filename = 'filename1.xlsx';
writetable(Table,filename);
header={'Data Number', 'Effective Thickness', 'Refractive Index',...
'geometrical factor', 'Concentration', 'Donated Density', 'Settle Time',...
'Electron Settle Time', 'Hole Settle Time',...
'Epsilon', 'Fill Factor', 'Maximum Time', 'Minimum Time',...
'Y-axis Maximum', 'Y-axis Minimum','Maximum Frequency',...
'Minimum Frequency', 'Chi_Texting', 'Charge Carrier Density, n(σ)',...
'Charge Carrier Density, n(ωp)', 'Effective Carrier Mobility'}; %etc
xlswrite(filename,header,1); %1 is the sheet number which is by default 1
[file,path] = uiputfile('filename1.xlsx');
winopen(filename)
  2 件のコメント
Ameer Hamza
Ameer Hamza 2020 年 4 月 6 日
uiputfile already gives the option to change the filename.
Jomei
Jomei 2020 年 4 月 6 日
Thanks for answering.
Sorry I didn't say really clear. This coding doesn't work perfectly. Because the first run the excel file 'filename1.xlsx' exist, so run second time it will have error.
And I pretty sure that I need to use uiputfile , but I don;t know how to use it.

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeData Import from MATLAB についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by