I'm writing an article for IEEE transactions using overleaf. I'm using algorithm and algorithmic to create a algorithm in my template, but the UNDEFINED CONTROL SEQUENCE
error appears. Below the code:
\documentclass[conference]{IEEEtran}
\usepackage[cmex10]{amsmath}
\usepackage{mathabx}
\usepackage{algorithm}
\usepackage{algorithmic}
\usepackage{array}
\usepackage{mdwmath}
\usepackage{mdwtab}
\usepackage{eqparbox}
\usepackage{url}
\begin{document}
\begin{algorithm}
\caption{Basic Algorithm}\label{basic}
\begin{algorithmic}
\for{i = 1 : nBytes}
\State $dataEBC = aes_encrypt_function(data(i),key)$
\State $modSignal = step (hMod, dataEBC)$
\State $noisySignal = step(hAWGN, modSignal)$
\State $receivedData = step(hDemod, noisySignal)$
\State $statedec(i) = aes_decrypt_function(receivedData, key)$
\EndFor
\end{algorithmic}
\end{algorithm}
\end{document}
Someone knows how to fix it?
Best Answer
Compile with
pdflatex
and run it. Many thanks to @Ilbant and @DavidCarslie for your precious helps.