a question about function -- uigetfile()

24 views (last 30 days)
the code
[FileName PathName]=uigetfile(('*.xlsx'), 'Choose a File');
runs Ok; but the code
[FileName PathName]=uigetfile(('*.xlsx','Excel Files(*.xlsx)'; '*.txt','Txt Files(*.txt)'), 'Choose a File');
runs wrongly. why? how should I modify it?

Accepted Answer

Adriano Bittar
Adriano Bittar on 6 Jun 2014
Edited: Stephen23 on 7 Dec 2015
Hi.. Try this code:
[filename, pathname] = uigetfile({'*.xlsx','Excel Files(*.xlsx)'; '*.txt','Txt Files(*.txt)'}, 'Pick a file');
I think it's only missing the {};

More Answers (0)

Community Treasure Hunt

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

Start Hunting!