I use the mcode latex package available here:
I use:
\lstinputlisting{G:/PROJECT_and_SEMINARS/sms/v.1.39.a.1/sms.m}[caption={Source code of program: SMS. Version:1.39.a.1}][firstnumber = 1]
command to import the matlab file. This imports and give me the code as is in the source file. However, my question is can any settings be made in mcode.sty so that the empty lines in the matlab source code be removed.. !! A solution to this will be very helpful
% LATEX DOCUMENT CODE:
\documentclass[08pt, a4paper, twoside]{Thesis}
\usepackage{framed}
\begin{document}
\begin{framed}
\lstinputlisting{.../sms.m}[caption={Source code of program: SMS. Version:1.39.a.1}] [firstnumber = 1]
\end{framed}
\end{document}
MATLAB CODE:
% SMS.V.1.39_a:start date Sept.01.2013
%<><><><><><><><><><><><><><><><><><>
smc2()
% smc3()
% sfea1d()
% sfea2()
%<><><><><><><><><><><><><><><><><><>
% IMPROVEMENT TYPE ABBREAVIATION
% VM:VARIABLE MANAGEMENT BR:BUG REMOVAL NF:NEW FUNCTION
% FE:FUNCTION EDIT NC:NEW CAPABILITY EH:ERROR HANDLING
% FF:FILE & FOLDER SO:SPEED OPTIMIZATION RD:RESULT DISPLAY
% FR:FUNCTION RENAME MM:MEMORY MANAGEMENT
%<><><><><><><><><><><><><><><><><><>

matlab-prettifierpackage; see this answer. – jub0bs Mar 02 '14 at 13:45