How to select only specific files from a folder that match a list of names stored in a cell and store in a separate folder?
3 次查看(过去 30 天)
显示 更早的评论
I have a list of 400 names (without the extention specified) stored in a column in a cell. I would like to select files with '.mat' extention from a folder that start with list of names provided in the cell. How may I go about doing that?
0 个评论
采纳的回答
Andrei Bobrov
2019-3-28
% Let A - list of 400 names as cell-array(400 x 1)
files = string(A) + '.mat';
n = numel(files);
C = struct;
for ii = 1:n
C.(A{ii}) = load(files{ii});
end
更多回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 File Operations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!