\documentclass[a4paper,10 pt]{article}
\usepackage{geometry}
\geometry{letterpaper, margin=0.8in}
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage[colorinlistoftodos]{todonotes}
\usepackage{float}
\usepackage[numbered]{mcode}
\title{Assignment that also uses matlab}
\author{Iain}
\date{24/03/2016}
\begin{document}
\maketitle
\newpage
\section{This is a section}
\subsection{This is a Subsection}
\begin{lstlisting}
for i = 1:12 %This is matlab code
X = 1+i;
end
\end{lstlisting}
\begin{figure}[H]
\caption{This is an image}
\centering
\includegraphics[width = 0.5\textwidth]{HOUGH1}
\label{fig:example}
\end{figure}
\end{document}