user1661261
user1661261

Reputation: 13

finding and openging a file with specific extension in MATLAB

Is there a way to open the file with a specific extension in MATLAB?

If there is only one file that has the extension '.aaa' in the folder, and I would like to open the file using 'fopen' regardless of the actual filename.

Upvotes: 1

Views: 550

Answers (1)

Thor
Thor

Reputation: 47099

Use the dir function:

files = dir('*.aaa');
files(1).name

Upvotes: 1

Related Questions