I am using this snippet of code to call an 'open file' dialog box in Matlab.
[img_file,img_path,filt] = uigetfile({ ...
'*.bff*;*.REC*;*.mat*','Our Image Files (*.bff, *.REC, *.mat)'; ...
'*.bff*','bff Files (*.bff)'; ...
'*.REC*','PAR-REC Files (*.REC)'; ...
'*.mat*','mat Files (*.mat)'}, ...
'Select An Image File');
if filt==0
return
end
The dialog opens, but .mat files appear grayed out (and unclickable).
I am using Matlab 7.13.0.564 on Mac Snow Leopard.
Any ideas what I'm doing wrong?
The problem is the wildcard *
after the file extension (eg *.mat*
) The code cannot find any files that satisfy this condition - because for your .mat
-files there is no additional character.
Hence, just use a wildcard before the file extension: *.mat
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.