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

조회 수: 3 (최근 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