What command prompts for file name then creates/opends file?
3 次查看(过去 30 天)
显示 更早的评论
What syntax would I use to make a script that would prompt the user to choose a file name then create/open that file?
Thank You
0 个评论
采纳的回答
Wayne King
2012-9-18
编辑:Wayne King
2012-9-18
Look at uigetfile
[filename, pathname, filterindex] = uigetfile( ...
{'*.mat','MAT-files (*.mat)'; ...
'*.mdl','Models (*.mdl)'; ...
'*.*', 'All Files (*.*)'}, ...
'Pick a file', ...
'MultiSelect', 'on');
and uiputfile.
If you don't want an UI option, you can also use input() with the 's' option to input a string and then use fread(), fwrite(), etc. to read and write the file.
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Programming Utilities 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!