What command prompts for file name then creates/opends file?

3 ビュー (過去 30 日間)
sono
sono 2012 年 9 月 18 日
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

採用された回答

Wayne King
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 件)

カテゴリ

Help Center および File ExchangeProgramming Utilities についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by