I am trying to insert matlab code using ERT:
Code: Select all
\lstset{language=Matlab,%
basicstyle=\ttfamily\singlespacing\footnotesize,
breaklines=true,%
morekeywords={matlab2tikz},
keywordstyle=\color{blue},%
morekeywords=[2]{1},
keywordstyle=[2]{\color{black}},
identifierstyle=\color{black},%
stringstyle=\color{mylilas},
commentstyle=\color{mygreen},%
showstringspaces=false,%without this there will be a symbol in the places where there is a space
numbers=left,%
numberstyle={\tiny\ttfamily\color{black}},% size of the numbers
numbersep=5pt, % this defines how far the numbers are from the text emph=[1]{for,end,break},emphstyle=[1]\color{red}, %some words to emphasise
caption=Code used for calculating the grand average of induced potentials.
}
\lstinputlisting{MATLAB_FILE.m}
Code: Select all
\usepackage{listings}
\usepackage{color} %red, green, blue, yellow, cyan, magenta, black, white
\definecolor{mygreen}{RGB}{28,172,0} % color values Red, Green, Blue
\definecolor{mylilas}{RGB}{170,55,241}
Code: Select all
Undefined control sequence.
\lstinputlisting{MATLAB_FILE.m}
\selectlanguage{english}%
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
Could you please help?