How to give a name to xlswrite with a dialogue box? (gui)
1 次查看(过去 30 天)
显示 更早的评论
Let say i have an matrix M. Then i want to make a excel file which contain this matrix M. The things that i usually use is a kind of static and manually with: xlswrite('test.xls',M).
I don't know how to make a flexible one. What I mean is, when i click "save" in my GUI figure, there'll some kind of dialogue box appear then i will give the name of it's excel file.
What to do? Thanks before :')
0 个评论
采纳的回答
Walter Roberson
2012-4-29
Use uiputfile() to get a target file name and target directory. Use fullfile() to splice the two name parts together to get a complete pathname. Pass that pathname to xlswrite()
2 个评论
Walter Roberson
2012-4-29
[filename, pathname] = uiputfile('*.xls', 'Choose a file name');
outname = fullfile(pathname, filename);
xlswrite(outname, M);
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Spreadsheets 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!