MATLAB: UIGETFILE start in another directory AND choose two default file types

uigetfile

I am using UIGETFILE to choose Excel files, with .xls AND .xlsx extension. Also, I want UIGETFILE to start in another directory. I already looked at the documentation and in this post. I know I would have to use something like this:
uigetfile([pwd '\folder1\*.xls'], 'Select file');
However, that would only allow me to select .xls files. I want it to allow me to select .xls files AND .xlsx files.
How can I do this?

Best Answer

uigetfile(fullfile(pwd,'folder1','*.xls;*.xlsx'),'select file')