Been trying to sort out for the past two hours why my figure referencing won't work and coming up with nothing. Any ideas? I've included my work so far.
\documentclass[a4paper,10pt]{article}
\usepackage[utf8]{inputenc} % and not inputence
\usepackage[T1]{fontenc} % [T1]
\usepackage{lmodern}
\usepackage[swedish]{babel}
\usepackage{graphicx}
\usepackage{mathtools}
\usepackage{float}
\usepackage{caption}
\graphicspath{{./MATLABimages/}}
\begin{document}
\title{Design of a haptic system\\Mekatronik Ak HT-12}
\date{20120919}
\maketitle
\newpage
\chapter{} %Kapitelindelning så att numreringen fungerar som den ska
\section{Task 2}
Verify by simulation that the DC-motor model works as intended by applying a reasonable voltage step (considering motor specifications) on the input and studying the time-domain response in terms of current, angular acceleration and angular velocity.
This was achieved by comparing model data for stall torque, no-load speed, angular acceleration and mechanical time constant to the numbers given in the data sheet.
\subsection{Stall torque}
The load, $T_L$, was set to zero, the system simulated in Simulink and the stall torque received (see figure~\ref{fig:torque} below) compared to the data sheet number of $0,718 Nm$.
\begin{figure}[H]
\centerline{\includegraphics[scale=0.05]{Task_2_stall_torque}}
\caption{Stall torque when no load is applied, $T_L=0$}
\label{fig:torque}
\end{figure}
\subsection{No-load speed}
The angular velocity of the system was simulated when the load was set to zero, $T_L=0$. As seen in figure~\ref{fig:velocity} below, the data received, $\dot{\phi}=552rad/s$, corresponded well to the given information in the data sheet.
\begin{figure}[H]
\centerline{\includegraphics[scale=0.05]{Task_2_angular_velocity}}
\caption{Stall torque when no load is applied $T_L=0$}
\label{fig:velocity}
\end{figure}
\subsection{Angular acceleration}
The angular acceleration of the system should peak instantly and then as the speed becomes constant decrease to zero. This scenario is depicted in the figure~\ref{fig:acceleration} below.
\begin{figure}[H]
\centerline{\includegraphics[scale=0.05]{Task_2_angular_acceleration}}
\caption{Angular acceleration with no load applied, $T_L=0$}
\label{fig:acceleration}
\end{figure}
\section{Task 3}
Yadiyadi
\section{Task 4}
Derive the gear ratio for the two planetary gears. Motivate your choice.
\end{document}
The three figure references show up in the text as figure "??" when I try to use \ref{fig:torque} for example.
The »article« class does not support chapters. You get a corresponding error message in the log file (*.log). Delete the \chapter command, compile again at least two times and it will work.
This is not the log file of the example you presented earlier. In that log there are multiple errors which you have to fix first. The log tells you exactly the lines where you have to do that.
I've gone over all the errors I could understand and as far as I know understand the only "errors" are the undefined references (which was my original problem). These are the error messages left:
LaTeX Warning: Reference `sec:diff' on page 2 undefined on input line 42.
<./MATLABimages/Task1_model.jpg, id=9, 1122.1925pt x 414.54875pt>
File: ./MATLABimages/Task1_model.jpg Graphic file (type jpg)
<use ./MATLABimages/Task1_model.jpg>
Package pdftex.def Info: ./MATLABimages/Task1_model.jpg used on input line 45.
(pdftex.def) Requested size: 448.86905pt x 165.81656pt.
[2 <./MATLABimages/Task1_model.jpg>]
LaTeX Warning: Reference `fig:velocity' on page 3 undefined on input line 109.
<./MATLABimages/Task_2_angular_velocity.jpg, id=23, 9323.83376pt x 4661.415pt>
File: ./MATLABimages/Task_2_angular_velocity.jpg Graphic file (type jpg)
<use ./MATLABimages/Task_2_angular_velocity.jpg>
Package pdftex.def Info: ./MATLABimages/Task_2_angular_velocity.jpg used on input line 112.
(pdftex.def) Requested size: 466.21901pt x 233.0844pt.
[3]
LaTeX Warning: Reference `fig:acceleration' on page 4 undefined on input line 118.
<./MATLABimages/Task_2_angular_acceleration.jpg, id=27, 9323.83376pt x 4586.13374pt>
File: ./MATLABimages/Task_2_angular_acceleration.jpg Graphic file (type jpg)
<use ./MATLABimages/Task_2_angular_acceleration.jpg>
Package pdftex.def Info: ./MATLABimages/Task_2_angular_acceleration.jpg used on input line 121.
(pdftex.def) Requested size: 466.21901pt x 229.32011pt.
[4 <./MATLABimages/Task_2_angular_velocity.jpg> <./MATLABimages/Task_2_angular_acceleration.jpg>] <./MATLABimages/Task_2_time_constant.jpg, id=31, 9323.83376pt x 4493.78876pt>
File: ./MATLABimages/Task_2_time_constant.jpg Graphic file (type jpg)
<use ./MATLABimages/Task_2_time_constant.jpg>
Package pdftex.def Info: ./MATLABimages/Task_2_time_constant.jpg used on input line 140.
(pdftex.def) Requested size: 466.21901pt x 224.7026pt.
[5 <./MATLABimages/Task_2_time_constant.jpg>] (./TSWLatexianTemp_Report.aux)
LaTeX Warning: There were undefined references.
LaTeX Warning: Label(s) may have changed. Rerun to get cross-references right.
Yes. Just to be absolutely clear: I use Latexian on a mac-computer and compile by previewing the current document in pdf-form. Is this the correct way to do it or am I missing a step?