Open a file not knowing the extension

8 views (last 30 days)
Hi,
I need to open some files but their extensions could be different whenever the code is run. Is there any way to open a file without knowing the actual extension, just based on the file's name?
  1 Comment
Jonas
Jonas on 15 Aug 2022
you could call the uiimport on that file, which can handle many file types. of course you have to choose variables manually

Sign in to comment.

Answers (1)

Image Analyst
Image Analyst on 15 Aug 2022
If you have windows you could do
winopen(filename);
To open it in the program that the operating system considers the default program for opening a file with that extension.

Products


Release

R2022a

Community Treasure Hunt

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

Start Hunting!