Hi all,I am using an recursive program to list out all c files inside a directory which contains folders and subfolders through recursion but i m getting out of memory issue,Can anybody suggest me ?? I think i need a terminating condition in for loop

1 vue (au cours des 30 derniers jours)
function search() Directory='C:\Users\Admin\Downloads'; [NeuronFileList]=findAllNeuronFiles(Directory); function NeuronFileList=findAllNeuronFiles(Directory)
NeuronFileList=dir(fullfile(Directory,'*.c'));
ListSubFold=dir(Directory); ListSubFold=ListSubFold([ListSubFold(:).isdir]);
for i=1:numel(ListSubFold) if ~strcmp(ListSubFold(i).name,'.') ~strcmp(ListSubFold(i).name,'..') NeuronFileList=[NeuronFileList;findAllNeuronFiles(fullfile(Directory,ListSubFold(i).name))]; end end
end end

Réponses (0)

Catégories

En savoir plus sur Startup and Shutdown dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by