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 Ansicht (letzte 30 Tage)
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

Antworten (0)

Kategorien

Mehr zu Startup and Shutdown finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by