I am trying to insert matlab code using ERT:
Code: Select all
Code, edit and compile here:
\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 spacenumbers=left,%numberstyle={\tiny\ttfamily\color{black}},% size of the numbersnumbersep=5pt, % this defines how far the numbers are from the text emph=[1]{for,end,break},emphstyle=[1]\color{red}, %some words to emphasisecaption=Code used for calculating the grand average of induced potentials.}\lstinputlisting{MATLAB_FILE.m}
Code: Select all
Code, edit and compile here:
\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 lineof your error message was never \def'ed. If you havemisspelled it (e.g., `\hobx'), type `I' and the correctspelling (e.g., `I\hbox'). Otherwise just continue,and I'll forget about whatever was undefined.
Could you please help?