Only display desired files using uigetfile

6 ビュー (過去 30 日間)
Sean Byrne
Sean Byrne 2017 年 10 月 6 日
コメント済み: Sean Byrne 2017 年 10 月 6 日
I want to use the uigetfile function to open a folder to select files. This is easy enough however the file location has a lot of different files and file names.
Thefore I want to be able to filter the folder to only show files that contain specific words in their file name. For example if the folder contained A1.mat, A2.Mat, B1.mat, B2.Mat, C1.mat, C2.Mat, D1.mat, D2.Mat and I only wanted the files with A intheir name can I wtire the code to display only files with A.
The code I currently have is:
[MATfiles,path2] = uigetfile('*.mat','Select MAT files' ...
, 'C:\Users\Sean\Desktop\Sean\PhD\Study 1\Outputs\SubjectMeans\'...
, 'MultiSelect','on');
nFiles = size(MATfiles,2);

採用された回答

ES
ES 2017 年 10 月 6 日
編集済み: ES 2017 年 10 月 6 日
Just use A*.mat for FILTERSPEC
[MATfiles,path2] = uigetfile('A*.mat','Select MAT files' ...
, 'C:\Users\Sean\Desktop\Sean\PhD\Study 1\Outputs\SubjectMeans\'...
, 'MultiSelect','on');
nFiles = size(MATfiles,2);
  1 件のコメント
Sean Byrne
Sean Byrne 2017 年 10 月 6 日
Thankyou

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeBehavior and Psychophysics についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by