I need to create a nested struct from nested folders
显示 更早的评论
I have some folders in the following way:
Folder 1
Folder 1.1
Folder 1.1.1
img 1.1.1.1
.
.
.
img 1.1.1.36 (between 35 to 37 imgs in each folder)
Folder 1.1.2
img 1.1.2.a
.
.
.
img 1.1.2.37 (between 35 to 37 imgs in each folder)
.
.
.
.
Folder 1.1.148098
I have to combine the img files to form videos. I am trying to create nested structures so that I can access the images (img 1.1.1.1. etc. in each folder). I have tried 'dir' but it does not create nested structures. These videos will be inputs for my ML model and I don't want to use multiple for loops if I can avoid it.
Specifically (apologies if I am providing redundant explanation), I want to do something like:
for i = 1: size(Folder1.Folder1.1.Folder1.1.1.Folder 1.1.1)
image= imread(Folder1.Folder1.1.Folder1.1.1.Folder 1.1.1.img1.1.1.i)
writevideo(v, image)
end
Any help is appreciated.
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 File Operations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!