matlab如何批量读取多个文件夹中的mat格式文件

2024-11-09 04:33:52
推荐回答(1个)
回答1:

p0 = '01科研\';
fnm = 'BenchMark_M.mat';
dt = dir(p0);
p = [dt.isdir];
pt = dt(p);
n = length(pt);
for k = 1:n
path = [p0 pt(k).name '\']
load([path fnm]);
end;