What command prompts for file name then creates/opends file?
조회 수: 4 (최근 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!