Sorting file from CSV
조회 수: 5 (최근 30일)
이전 댓글 표시
I want to sort a set of images whose data is given in .csv format.
The data consists of three different types in three columns, by indicating 1 for the specific type and 0 if not.
I want to separate it the whole set of images into three folders using the given .csv data.
Please help.
댓글 수: 2
Bob Thompson
2018년 4월 17일
I'm a little confused on what you are asking for. Does each column independently represent an image, and you want to separate the columns into unique files? Or does the data contain three columns and a certain number of rows and you want to separate the data by those rows?
답변 (1개)
Bob Thompson
2018년 4월 17일
Ok, so you're trying to collect a set of file names?
I would suggest organizing using indexing then.
A = % Data block here
B = A(A(:,2)==1,1); % Select file names (column 1) which corresponds to 1's
& in column 2.
C = A(A(:,3)==1,1); % 1's in column 3
D = A(A(:,4)==1,1); % 1's in column 4
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Shifting and Sorting Matrices에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!