How can I combine features for one class into one mat file?
조회 수: 3 (최근 30일)
이전 댓글 표시
I have 10 mat files for 10 images, file consists features. How can I combine these 10 files into a file? I have to combine one after one.
댓글 수: 0
답변 (1개)
Walter Roberson
2017년 12월 14일
Assuming that the file names start with 'feature' and that the variable is named 'features' in each of them:
dinfo = dir('feature*.mat');
numfile = length(dinfo);
featcell = cell(numfile, 1);
for K = 1 : numfile
thisfile = dinfo(K).name;
datastruct = load(thisfile, 'features');
featcell{K} = datastruct.features;
end
features = cell2mat(featcell);
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Image Segmentation and Analysis에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!