How can I combine features for one class into one mat file?

3 ビュー (過去 30 日間)
bamini thavarajah
bamini thavarajah 2017 年 12 月 14 日
回答済み: Walter Roberson 2017 年 12 月 14 日
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.

回答 (1 件)

Walter Roberson
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);

カテゴリ

Help Center および File ExchangeImage Segmentation and Analysis についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by