How do i load a file automatically in a particular folder just by a part of the filename?

4 次查看(过去 30 天)
I have a file named 'Annot_CU' in a folder.I want to load this file just finding the word 'Annot' in the particular folder.
I am not able to find the code to this .
Thank you in advance.

采纳的回答

Rik
Rik 2019-5-13
folder='C:\Path\To\Your\Data';
list_of_files=dir(fullfile(folder,'Annot*'));
%remove any matching folders
list_of_files([list_of_files.isdir])=[];

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Startup and Shutdown 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by