Which is better to use in my case -uigetfile or uigetdir?

1 回表示 (過去 30 日間)
Ashish
Ashish 2014 年 6 月 24 日
編集済み: Ashish 2014 年 6 月 24 日
I have a archived files in the following location- C:\Archive\project_dir\project_folder.
I have a Browse button in the GUI, which should allow to choose the entire project folder (It consists of .mat files). Which command is better for my requirement, uigetfile or uigetdir?
Note: Also, I need to have a check if the user has selected the file within the folder C:\Archive\project_dir. It is not possible to select the project_folder outside this directory location.

採用された回答

Azzi Abdelmalek
Azzi Abdelmalek 2014 年 6 月 24 日
f='C:\Archive\project_dir\project_folder\'
[file,pat]=uigetfile(f,'*.mat')
yourfile=fullfile(pat,file)
test=isequal(f,pat) % to check if the user has selected the right folder
  1 件のコメント
Ashish
Ashish 2014 年 6 月 24 日
編集済み: Ashish 2014 年 6 月 24 日
Thanks Azzi.
Actually, I have to select the project folder and not the .mat files within. When running the code, I am not able to select the entire folder!
Can you suggest a solution?

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMigrate GUIDE Apps についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by