Can one use uigetfile or other dialog prompt to create a file if it doesn't exist?

조회 수: 3 (최근 30일)
I'm coding a "Save As..." option in a GUI, and I'd like for the user to browse to a folder to save a .mat file of relevant variables. In the uigetfile dialog, if the user specifies a file name that doesn't exist, the dialog displays an error to that effect, but can't create the file. What I'd like to do is to create the file through the dialog if it doesn't already exist, then write to that file. What's a good way to do this?

채택된 답변

Walter Roberson
Walter Roberson 2018년 3월 16일
Use uiputfile()

추가 답변 (1개)

Jason
Jason 2018년 3월 16일
Ah, life makes sense again. Thank you.

카테고리

Help CenterFile Exchange에서 App Building에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by