Why am I unable to select a file when I use 'uigetfile' function on the newest Mac operation system 'Catalina'.

조회 수: 30 (최근 30일)
I used the 'uigetfile' in the following command:
[sfile,spath,indx] = uigetfile({'*.mat','MAT';'I.*','DICOM'});
For the first option 'MAT', its corresponding files are bright and selectable. However, when I choose 'DICOM' option on the Mac dialog, all files named with ‘I.*’ are still in gray, and I can't select any of them. My matlab is R2018a for mac.
Thanks.
  댓글 수: 3
Thierry Reynaud
Thierry Reynaud 2020년 6월 22일
I have the same problem catalina+Matlab R2020a (or 2018b).
the command:
[file,path] = uigetfile('*.nc'); is working and file finishing with nc are visible
but
[file,path] = uigetfile({'*.m';'*.slx';'*.mat';'*.nc'},...
'File Selector');
nc ended files remains grey even if I choose nc with the option button
Ajit Chaudhari
Ajit Chaudhari 2024년 1월 11일
This issue has cropped up for me now with Ventura 13.6.3 and Matlab R2022a. It worked fine on 12/20/2023 before I ran the latest incremental MacOS system update. Anyone know if upgrading Matlab to the latest version fixes it?

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

채택된 답변

Anders Barth
Anders Barth 2019년 11월 27일
편집: Walter Roberson 2019년 11월 27일
We are having the same issue on 2019b Update 2 and MacOS Catalina (10.15.1). There seems to be issues with the communication between Matlab and the native file chooser in Catalina.
For now, we are using a custom implementation based on this submission, which works but is missing the native integration into the file system:

추가 답변 (3개)

Minoru Tsuzaki
Minoru Tsuzaki 2021년 5월 23일
I have the same problem with Matlab 2021a and Mac OS 10.15.7.
I did my own workarounds based on Ike's direction. My addtion is to put a couple of lines after accepting any type of files by uigetfile.
The following lines are an example when I want to filter several type of audio files.
(The example is not kind enough to tell users what type is acceptalble. It would be better for you to revise the error message lines.)
[file,path] = uigetfile('*');
[~,~,anExt]=fileparts(file);
idx = find(strcmp(anExt,{'.wav','.aif','.m4a','.mp4'})) ;
if isempty(idx)
uiwait(msgbox('Unsupported file type.','Error','error'));
else
% processing for the proper file type.
end

Sulaymon Eshkabilov
Sulaymon Eshkabilov 2019년 10월 8일
hi,
here are some hints.

Ike Brown
Ike Brown 2020년 3월 21일
편집: Ike Brown 2020년 3월 21일
This isn't a complete fix, but you if you know the file extension you want, you can get around this issue by specifying the file extension in uigetfile. For example, [file,path]=uigetfile will only allow you to select MatLab files. However, [file,path]=uigetfile('*.csv') will allow you to select any .csv file.
Update: [file,path]=uigetfile('*') appears to let you select any file extension

카테고리

Help CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

태그

제품


릴리스

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by