Using MatLab 2022b, I am .txt files are grayed out when I use 'uigetfile' function on the newest Mac operation system 'Monterey' V 12.6.1
16 ビュー (過去 30 日間)
古いコメントを表示
I am running MatLab R2022b on a Macbook Pro running the OS Monterey V12.6.1
when I evalulate:
[fileName,pathName] = uigetfile({'*.txt.gz';'*.txt';'*.*'}, 'Select input file');
The popup window opens to select a file, I click on Options and Enable 'All files' or .txt files it doesn't 'ungray'/enable anything obvious (there are .txt files in many directories...).
I've checked the MathWorks support sight and this problem has been reported previously as early as R2019
Please help!
1 件のコメント
cr
2022 年 12 月 5 日
Interesting. I see that it is specific to osx only as I don't see it in R2019a on win7, but very much there on BigSur. Putting multiple filter spec inside flower braces seems to make it dysfunctional.
回答 (1 件)
Daniel Dolan
2023 年 5 月 26 日
I don't have a complete solution, but it seems that putting *.* up front helps.
[fileName,pathName] = uigetfile({'*.*';'*.txt.gz';'*.txt';}, 'Select input file');
2 件のコメント
M. A. Hopcroft
約2時間 前
編集済み: M. A. Hopcroft
約2時間 前
Good find, this works for me also. It looks like the first item in the array of filters is handled correctly, and the rest are not. So if the first item is "all files", then all files can be selected, but thats not filtering anything. As another workaround, you can combine the file types in one entry. So, for example if you want to filter for text and csv, you can use:
{'*.csv;*.txt'}
because it is only one item in the array. But the following will NOT work (although the docs say it should):
{'*.csv';'*.txt'}
Also you can't use custom labels for the file types, as far as I can work out.
参考
カテゴリ
Help Center および File Exchange で Programming Utilities についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!