file management

조회 수: 2 (최근 30일)
lowcalorie
lowcalorie 2012년 3월 12일
I need to ask the user to enter the input file name. Make them repeat until an existing file is found.
please help Im not sure how to do this i am new to managing files with matlab
  댓글 수: 1
Jan
Jan 2012년 3월 12일
What did you try so far and which problem occurred?

댓글을 달려면 로그인하십시오.

답변 (1개)

Honglei Chen
Honglei Chen 2012년 3월 12일
You can use dir to read in the file listing in the current directory. Then you can use input to get the the file name from command line. If the specified file name is in the file listing, proceed; otherwise, ask a different file name again.
doc dir
doc input
Alternatively, you can use uigetfile to ask the user to choose a file.
doc uigetfile

카테고리

Help CenterFile Exchange에서 File Operations에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by