How to select specific files from all the files in a folder?
조회 수: 59(최근 30일)
Benjamin Thompson 2022년 2월 2일
You can get a file or directory listing in MATLAB using dir, and assign that to a workspace variable. Then loop through the elements in the array to tets the name field against your criteria. See the help article "Manage Files and Folder", you have the mkdir command, movefile command. Use copyfile for the copy, which oddly enough is not mentioned with the others in that article.
D = dir('*.*')
48×1 struct array with fields: