file management

2 Ansichten (letzte 30 Tage)
lowcalorie
lowcalorie am 12 Mär. 2012
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 Kommentar
Jan
Jan am 12 Mär. 2012
What did you try so far and which problem occurred?

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Honglei Chen
Honglei Chen am 12 Mär. 2012
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

Kategorien

Mehr zu File Operations finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by