% Performs batch analysis of several folders

% select folder needed to be analysed
foldersList = uigetfile_n_dir('C:\', 'Please select folders to be analysed');
for i = 1:length(foldersList)
    PARAM.folder = foldersList{i};
    
    %executes live scripts and saves the results
    matlab.internal.liveeditor.executeAndSave('C:\Main_Matlab_LiveScript.mlx'); %replace with the location of livescript
    
    %converts result to pdf
    matlab.internal.liveeditor.openAndConvert('C:\Main_Matlab_LiveScript.mlx', strcat(foldersList{i}, '\AnalysisResult.pdf'));
    clearvars -except foldersList PARAM i;
end