error: containers.Map: specified key <.> does not exist
时间: 2024-04-17 16:29:09 浏览: 168
Special_topics_containers_map_2018.pdf
抱歉,MATLAB 中没有直接对应的容器类型来实现字典。您可以使用结构体来替代字典的功能。请尝试以下代码:
value = {};
for i = 1:length(floders)
floder = floders{i};
disp(floder);
imgname = strsplit(floder, '_');
imgname = imgname{1};
idx = tinydict.(imgname);
value{end+1} = idx;
value{end+1} = floder;
sum = 0;
imgs = dir(fullfile(floderPath, floder));
for j = 1:length(imgs)
img = imgs(j).name;
brisq.get_feature(fullfile(floderPath, floder, img));
score = brisq.get_score(fullfile(floderPath, floder, img));
disp(score);
sum = sum + score;
end
value{end+1} = sum/frames;
disp(sum/frames);
s = struct(value, df.columns);
df = [df; s];
value = {};
end
writetable(df, outpath);
阅读全文