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)
Ältere Kommentare anzeigen
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
0 Kommentare
Antworten (0)
Siehe auch
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!