uigetfile filter error with 2025a works fine in 2024b
Show older comments
I use uigetfile to open various types of files for my users mostly txt, but I want to be more specific.
for example
[infile, apploc] = uigetfile('*Stim*.txt', 'Select a Stimulus File',infile);
it pops up fine in 2024b but when I run it in 2025a I get this error and the filter doesn't apply.
Warning: Invalid file filter *Stim*.txt
Does 2025b fix this or must I go back to 2024b?
Answers (1)
Akira Agata
on 29 Oct 2025
For your purpose, the following syntax is correct and works in both MATLAB version:
[infile, apploc] = uigetfile("*.txt", "Select a Stimulus File", "*Stim*.txt");
5 Comments
Gavin
on 29 Oct 2025
Gavin
on 29 Oct 2025
Gavin
on 31 Oct 2025
Walter Roberson
on 31 Oct 2025
@Gavin By "right type" do you mean that you want the file name to be fixed but the user to have the choice of file extensions? Or do you mean that you want the user to be able to change the file name while keeping the file extension fixed? Or something else?
Gavin
on 4 Nov 2025
Categories
Find more on App Building in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!