how filter "*.*" when using uigetfile function.

5 Ansichten (letzte 30 Tage)
CoderMinga
CoderMinga am 16 Sep. 2022
Bearbeitet: Stephen23 am 16 Sep. 2022
when load a file by uigetfile can see (*.*) , althougth i only filter the "*.mat";"*.xls";"*.xlsx" . so how can i implement the drop-down menu is not displayed(*.*)
[FileName, FilePath] = uigetfile(["*.mat";"*.xls";"*.xlsx"]);

Akzeptierte Antwort

Stephen23
Stephen23 am 16 Sep. 2022
Bearbeitet: Stephen23 am 16 Sep. 2022
If there are no descriptors, the "All files" is automatically appened onto the end of the filter. The solution is to add descriptors to your filter string array, e.g.:
[FileName, FilePath] = uigetfile(["*.mat","ABC";"*.xls","DEF";"*.xlsx","GHI"])
Of course you should change the descriptors to suit those file extensions.

Weitere Antworten (0)

Kategorien

Mehr zu Specifying Target for Graphics Output finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by