I would like to list all the .avi files in all levels of depth of subdirectories, starting from a parent path. The naming and the level of depth of the directories are arbitrary.
For example, if I give C:\banana\ as a parentpath, with the following structure:
I would like to get all the paths to the above mentioned avis. From what I understand from the documentation there is no built-in function which gives me this functionality.
genpath seems quite promising though, in that it gives me all the directories in all levels of depth starting from a parent path.
The downside is that it gives me a string, in which all the paths are separated by a semi-colon.
I guess I have to combine the functionality of genpath and ls. I would have to make a list from the string given by genpath, turn it into an array of strings which would in turn be put in ls through the use of a for-loop.
I can than evaluate the resulting ls lists on the presence of avi's.
This solution however doesn't feel as straightforward as it could be. Is there a functionality of MATLAB I have overlooked?
Any suggestions are much appreciated!