Link .CSV file to image file names

조회 수: 3 (최근 30일)
montek singh
montek singh 2017년 12월 7일
답변: Duncan Lilley 2017년 12월 12일
I am new to matlab
I have 2 datasets- csv file and images The name of image is stored in a csv file along with its class.
Is there any way to map the image files to classes in csv such that all the files of one category lie is one sub folder

답변 (1개)

Duncan Lilley
Duncan Lilley 2017년 12월 12일
Hello,
First you will want to import the data from your CSV file. In MATLAB, you can right-click on the file in the Current Folder browser and select "Import Data...". Then, once you have made sure that the data will be imported correctly, you can choose the drop-down menu under "Import Selection" and generate a script or function to import this data in the future. More information about importing data in this way can be found on the documentation page for "uiimport".
Once the data is imported, you can iterate through the resulting data structure using a for-loop. Then, for each entry, you can move the corresponding image file to a subfolder determined by the category of the image. Files can be moved using the "movefile" function.

카테고리

Help CenterFile Exchange에서 Data Import and Analysis에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by