My thesis supervisor requires me to include all my MATLAB code in the PDF. My code is scattered in a dozen .m files, all in the same folder.
I know I can include code, using the matlab-prettifier package, and I do so as follows:
\lstinputlisting[style=Matlab-editor]{codice/ICCplot.m}
In essence, I want to do the following:
for \filename in codice/*.m
\section{\filename}
\lstinputlisting[style=Matlab-editor]{codice/\filename.m}
end for