cleaned header.tex

This commit is contained in:
Jan Benda 2017-11-28 13:45:41 +01:00
parent eafb491ab3
commit 7f0c3e4544
2 changed files with 107 additions and 87 deletions

View File

@ -1,32 +1,38 @@
%%%%% title %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\title{\textbf{\huge\sffamily\tr{Introduction to\\[1ex] Scientific Computing}%
{Einf\"uhrung in die\\[1ex] wissenschaftliche Datenverarbeitung}}}
%%%%% title %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \author{{\LARGE Jan Grewe \& Jan Benda}\\[5ex]Abteilung Neuroethologie\\[2ex]%
\title{\textbf{\huge\sffamily\tr{Introduction to\\[1ex] Scientific Computing}{Einf\"uhrung in die\\[1ex] wissenschaftliche Datenverarbeitung}}} \includegraphics[width=0.3\textwidth]{UT_WBMW_Rot_RGB}\vspace{3ex}}
\author{{\LARGE Jan Grewe \& Jan Benda}\\[5ex]Abteilung Neuroethologie\\[2ex]\includegraphics[width=0.3\textwidth]{UT_WBMW_Rot_RGB}\vspace{3ex}}
\date{WS 2017/2018\\\vfill \centerline{\includegraphics[width=0.7\textwidth]{announcements/correlationcartoon}\rotatebox{90}{\footnotesize\url{www.xkcd.com}}}}
%%%% language %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \date{WS 2017/2018\\\vfill%
% \newcommand{\tr}[2]{#1} % en \centerline{\includegraphics[width=0.7\textwidth]{announcements/correlationcartoon}%
% \usepackage[english]{babel} \rotatebox{90}{\footnotesize\url{www.xkcd.com}}}}
%%%% language %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand{\tr}[2]{#1} % en \newcommand{\tr}[2]{#1} % en
% \newcommand{\tr}[2]{#2} % de
\usepackage[ngerman,english]{babel} \usepackage[ngerman,english]{babel}
%%%% encoding %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%% encoding %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage[T1]{fontenc} \usepackage[T1]{fontenc}
%%%% layout %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%% fonts %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage[left=25mm,right=25mm,top=20mm,bottom=30mm]{geometry}
\usepackage{pslatex} % nice font for pdf file \usepackage{pslatex} % nice font for pdf file
%%%% layout %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage[left=25mm,right=25mm,top=20mm,bottom=30mm]{geometry}
\usepackage[within=chapter]{newfloat} \usepackage[within=chapter]{newfloat}
\usepackage{tocloft} \usepackage{tocloft}
\setlength{\cftfigindent}{1.2em} \setlength{\cftfigindent}{1.2em}
\setlength{\cftfignumwidth}{2.6em} \setlength{\cftfignumwidth}{2.6em}
%%%%% section style %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%% section style %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage[sf,bf,it,big,clearempty]{titlesec} \usepackage[sf,bf,it,big,clearempty]{titlesec}
\setcounter{secnumdepth}{1} \setcounter{secnumdepth}{1}
\setcounter{tocdepth}{1} \setcounter{tocdepth}{1}
%%%%% index %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%% index %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage[makeindex]{splitidx} \usepackage[makeindex]{splitidx}
\makeindex \makeindex
\usepackage[totoc]{idxlayout} \usepackage[totoc]{idxlayout}
@ -36,14 +42,14 @@
\newindex[\tr{MATLAB code}{MATLAB Code}]{mcode} \newindex[\tr{MATLAB code}{MATLAB Code}]{mcode}
\newindex[\tr{Python code}{Python Code}]{pcode} \newindex[\tr{Python code}{Python Code}]{pcode}
%%%%% units %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%% units %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage[mediumspace,mediumqspace,Gray]{SIunits} % \ohm, \micro \usepackage[mediumspace,mediumqspace,Gray]{SIunits} % \ohm, \micro
%%%%% graphics %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%% graphics %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{subcaption} \usepackage{subcaption}
\usepackage{graphicx} \usepackage{graphicx}
%%%%%%%%%%%%% colors %%%%%%%%%%%%%%%% %%%%%%%%%%%%% colors %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{xcolor} \usepackage{xcolor}
\definecolor{myyellow}{HTML}{FFEE00} \definecolor{myyellow}{HTML}{FFEE00}
\definecolor{myblue}{HTML}{0055DD} \definecolor{myblue}{HTML}{0055DD}
@ -60,7 +66,7 @@
\pagecolor{white} \pagecolor{white}
%%%%% figures %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%% figures %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% gnuplot figures: % gnuplot figures:
\newcommand{\texinputpath}{} \newcommand{\texinputpath}{}
\newcommand{\texpicture}[1]{{\sffamily\footnotesize\input{\texinputpath#1.tex}}} \newcommand{\texpicture}[1]{{\sffamily\footnotesize\input{\texinputpath#1.tex}}}
@ -100,7 +106,7 @@
% put caption on separate float: % put caption on separate float:
\newcommand{\breakfloat}{\end{figure}\begin{figure}[t]} \newcommand{\breakfloat}{\end{figure}\begin{figure}[t]}
%%%%% figure references %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%% figure references %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% references to panels of a figure within the caption: % references to panels of a figure within the caption:
\newcommand{\figitem}[1]{\textsf{\bfseries\uppercase{#1}}} \newcommand{\figitem}[1]{\textsf{\bfseries\uppercase{#1}}}
% references to figures: % references to figures:
@ -128,7 +134,10 @@
\newcommand{\subfigrefb}[2]{\figb~\subfref{#1}{#2}} \newcommand{\subfigrefb}[2]{\figb~\subfref{#1}{#2}}
\newcommand{\subfigsrefb}[2]{\figsb~\subfref{#1}{#2}} \newcommand{\subfigsrefb}[2]{\figsb~\subfref{#1}{#2}}
%%%%% table references %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%% tables %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{multirow}
%%%%% table references %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand{\tref}[1]{\textup{\ref{#1}}} \newcommand{\tref}[1]{\textup{\ref{#1}}}
% references to tables in normal text: % references to tables in normal text:
\newcommand{\tab}{\tr{Tab.}{Tabelle}} \newcommand{\tab}{\tr{Tab.}{Tabelle}}
@ -150,7 +159,7 @@
% invisible rule for expanding the height of a row in a table body: % invisible rule for expanding the height of a row in a table body:
\newcommand{\erb}{\rule{0pt}{2.5ex}} \newcommand{\erb}{\rule{0pt}{2.5ex}}
%%%%% equation references %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%% equation references %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%\newcommand{\eqref}[1]{(\ref{#1})} %\newcommand{\eqref}[1]{(\ref{#1})}
\newcommand{\eqn}{\tr{Eq}{Gl}.} \newcommand{\eqn}{\tr{Eq}{Gl}.}
\newcommand{\Eqn}{\tr{Eq}{Gl}.} \newcommand{\Eqn}{\tr{Eq}{Gl}.}
@ -161,7 +170,19 @@
\newcommand{\eqnsref}[1]{\eqns~\eqref{#1}} \newcommand{\eqnsref}[1]{\eqns~\eqref{#1}}
\newcommand{\Eqnsref}[1]{\Eqns~\eqref{#1}} \newcommand{\Eqnsref}[1]{\Eqns~\eqref{#1}}
%%%%% listings %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%% math stuff: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{amsmath}
\usepackage{bm}
\usepackage{dsfont}
\newcommand{\naZ}{\mathds{N}}
\newcommand{\gaZ}{\mathds{Z}}
\newcommand{\raZ}{\mathds{Q}}
\newcommand{\reZ}{\mathds{R}}
\newcommand{\reZp}{\mathds{R^+}}
\newcommand{\reZpN}{\mathds{R^+_0}}
\newcommand{\koZ}{\mathds{C}}
%%%%% listings %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{listings} \usepackage{listings}
\lstset{ \lstset{
basicstyle=\ttfamily\footnotesize, basicstyle=\ttfamily\footnotesize,
@ -189,22 +210,7 @@
\let\l@lstlisting\l@figure \let\l@lstlisting\l@figure
\makeatother \makeatother
%%%%%%%%%%%%% Table stuff %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%% english, german, code and file terms: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{multirow}
%%%%% math stuff: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{amsmath}
\usepackage{bm}
\usepackage{dsfont}
\newcommand{\naZ}{\mathds{N}}
\newcommand{\gaZ}{\mathds{Z}}
\newcommand{\raZ}{\mathds{Q}}
\newcommand{\reZ}{\mathds{R}}
\newcommand{\reZp}{\mathds{R^+}}
\newcommand{\reZpN}{\mathds{R^+_0}}
\newcommand{\koZ}{\mathds{C}}
%%%%% english, german, code and file terms: %%%%%%%%%%%%%%%
\usepackage{ifthen} \usepackage{ifthen}
\newcommand{\enterm}[2][]{\tr{\textit{#2}}{``#2''}\ifthenelse{\equal{#1}{}}{\tr{\protect\sindex[term]{#2}}{\protect\sindex[enterm]{#2}}}{\tr{\protect\sindex[term]{#1}}{\protect\sindex[enterm]{#1}}}} \newcommand{\enterm}[2][]{\tr{\textit{#2}}{``#2''}\ifthenelse{\equal{#1}{}}{\tr{\protect\sindex[term]{#2}}{\protect\sindex[enterm]{#2}}}{\tr{\protect\sindex[term]{#1}}{\protect\sindex[enterm]{#1}}}}
\newcommand{\determ}[2][]{\tr{``#2''}{\textit{#2}}\ifthenelse{\equal{#1}{}}{\tr{\protect\sindex[determ]{#2}}{\protect\sindex[term]{#2}}}{\tr{\protect\sindex[determ]{#1}}{\protect\sindex[term]{#1}}}} \newcommand{\determ}[2][]{\tr{``#2''}{\textit{#2}}\ifthenelse{\equal{#1}{}}{\tr{\protect\sindex[determ]{#2}}{\protect\sindex[term]{#2}}}{\tr{\protect\sindex[determ]{#1}}{\protect\sindex[term]{#1}}}}
@ -214,13 +220,13 @@
% for escaping special characters into the index: % for escaping special characters into the index:
\newcommand{\scor}{"|} \newcommand{\scor}{"|}
%%%%% key-shortcuts %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%% key-shortcuts %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{tikz} \usepackage{tikz}
\usetikzlibrary{shapes} \usetikzlibrary{shapes}
\tikzstyle{keybox} = [draw=blue!50!black,fill=white,thick,rectangle,rounded corners,inner sep=3pt,inner ysep=2pt] \tikzstyle{keybox} = [draw=blue!50!black,fill=white,thick,rectangle,rounded corners,inner sep=3pt,inner ysep=2pt]
\newcommand{\keycode}[1]{\begin{tikzpicture}[baseline=(box.base)]\node[keybox](box){\texttt{#1}};\end{tikzpicture}} \newcommand{\keycode}[1]{\begin{tikzpicture}[baseline=(box.base)]\node[keybox](box){\texttt{#1}};\end{tikzpicture}}
%%%%% code/matlab commands: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%% code/matlab commands: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{textcomp} \usepackage{textcomp}
% typeset code inline: % typeset code inline:
@ -249,14 +255,14 @@
\newcommand{\matlabfun}[1]{(\tr{\matlab-function}{\matlab-Funktion} \varcode{#1})\protect\sindex[mcode]{#1}} \newcommand{\matlabfun}[1]{(\tr{\matlab-function}{\matlab-Funktion} \varcode{#1})\protect\sindex[mcode]{#1}}
%%%%% shortquote and widequote commands: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%% shortquote and widequote commands: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \shortquote{Something to be quoted}{Source} % \shortquote{Something to be quoted}{Source}
\newcommand{\shortquote}[2]{\begin{list}{}{\rightmargin\leftmargin}\item\relax\itshape #1 \hfill \upshape #2\end{list}} \newcommand{\shortquote}[2]{\begin{list}{}{\rightmargin\leftmargin}\item\relax\itshape #1 \hfill \upshape #2\end{list}}
% \widequote{Something to be quoted}{Source} % \widequote{Something to be quoted}{Source}
\newcommand{\widequote}[2]{{\itshape #1} \hfill #2} \newcommand{\widequote}[2]{{\itshape #1} \hfill #2}
%%%%% exercises environment: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%% exercises environment: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% usage: % usage:
% %
% \begin{exercise}{somecode.m}{someoutput.out} % \begin{exercise}{somecode.m}{someoutput.out}
@ -272,7 +278,7 @@
% Output: % Output:
% content of someoutput.out % content of someoutput.out
% %
% Innerhalb der exercise Umgebung ist enumerate umdefiniert, um (a), (b), (c), .. zu erzeugen. % Within the exercise environment enumerate is redefined to generate (a), (b), (c), ...
\usepackage{mdframed} \usepackage{mdframed}
\usepackage{xstring} \usepackage{xstring}
\newlistof{exercisef}{loe}{\tr{Exercises}{\"Ubungen}} \newlistof{exercisef}{loe}{\tr{Exercises}{\"Ubungen}}
@ -287,31 +293,40 @@
\newboolean{showexercisesolutions} \newboolean{showexercisesolutions}
\setboolean{showexercisesolutions}{true} \setboolean{showexercisesolutions}{true}
\newenvironment{exercise}[2]% \newenvironment{exercise}[2]%
{\newcommand{\exercisesource}{#1}% { \newcommand{\exercisesource}{#1}%
\newcommand{\exercisefile}{\protect\StrSubstitute{#1}{_}{\_}}% \newcommand{\exercisefile}{\protect\StrSubstitute{#1}{_}{\_}}%
\newcommand{\exerciseoutput}{#2}% \newcommand{\exerciseoutput}{#2}%
\setlength{\fboxsep}{2mm}% \setlength{\fboxsep}{2mm}%
\newcommand{\saveenumi}{\theenumi}\renewcommand{\labelenumi}{(\alph{enumi})}% \newcommand{\saveenumi}{\theenumi}\renewcommand{\labelenumi}{(\alph{enumi})}%
\captionsetup{singlelinecheck=off,hypcap=false,labelfont={large,sf,it,bf},font={large,sf,it,bf},skip={0.5ex}}% \captionsetup{singlelinecheck=off,hypcap=false,labelfont={large,sf,it,bf},%
font={large,sf,it,bf},skip={0.5ex}}%
\begin{mdframed}[linewidth=0pt,backgroundcolor=exerciseback]% \begin{mdframed}[linewidth=0pt,backgroundcolor=exerciseback]%
\captionof{exercisef}[\exercisefile]{}% \captionof{exercisef}[\exercisefile]{}%
\captionsetup{font={normal,sf,it}}% \captionsetup{font={normal,sf,it}}%
}% }%
{\hypersetup{hypertexnames=false}% { \renewcommand{\theenumi}{\saveenumi}%
\ifthenelse{\boolean{showexercisesolutions}}%
{ \hypersetup{hypertexnames=false}%
\ifthenelse{\equal{\exercisesource}{}}{}% \ifthenelse{\equal{\exercisesource}{}}{}%
{\ifthenelse{\boolean{showexercisesolutions}}% { \addtocounter{lstlisting}{-1}%
{\addtocounter{lstlisting}{-1}% \lstinputlisting[belowskip=0pt,aboveskip=1ex,nolol=true,%
\lstinputlisting[belowskip=0pt,aboveskip=1ex,nolol=true,title={\textbf{\tr{Solution}{L\"osung}:} \exercisefile}]{\codepath\exercisesource}% title={\textbf{\tr{Solution}{L\"osung}:} \exercisefile}]%
{\codepath\exercisesource}%
\ifthenelse{\equal{\exerciseoutput}{}}{}% \ifthenelse{\equal{\exerciseoutput}{}}{}%
{\addtocounter{lstlisting}{-1}% { \addtocounter{lstlisting}{-1}%
\lstinputlisting[language={},title={\textbf{\tr{Output}{Ausgabe}:}},nolol=true,belowskip=0pt]{\codepath\exerciseoutput}}}{}}% \lstinputlisting[language={},title={\textbf{\tr{Output}{Ausgabe}:}},%
nolol=true,belowskip=0pt]%
{\codepath\exerciseoutput}%
}%
}%
\hypersetup{hypertexnames=true}% \hypersetup{hypertexnames=true}%
}{}%
\end{mdframed}% \end{mdframed}%
\renewcommand{\theenumi}{\saveenumi}} }
\setlength{\cftexercisefindent}{1.2em} \setlength{\cftexercisefindent}{1.2em}
\setlength{\cftexercisefnumwidth}{2.6em} \setlength{\cftexercisefnumwidth}{2.6em}
%%%%% info box environment: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%% info box environment: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% usage: % usage:
% %
% \begin{ibox}[tp]{Python} % \begin{ibox}[tp]{Python}
@ -345,7 +360,7 @@
\setlength{\cftiboxfnumwidth}{2.6em} \setlength{\cftiboxfnumwidth}{2.6em}
%%%%% important environment: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%% important environment: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% usage: % usage:
% %
% \begin{important}[Apples are important] % \begin{important}[Apples are important]
@ -363,21 +378,26 @@
% chapterlistsgaps=on, % chapterlistsgaps=on,
% ]{importantf} % ]{importantf}
\newenvironment{important}[1][]% \newenvironment{important}[1][]%
{\captionsetup{singlelinecheck=off,hypcap=false,labelformat={empty},labelfont={large,sf,it,bf},font={large,sf,it,bf}} { \captionsetup{singlelinecheck=off,hypcap=false,labelformat={empty},%
labelfont={large,sf,it,bf},font={large,sf,it,bf}}
\ifthenelse{\equal{#1}{}}% \ifthenelse{\equal{#1}{}}%
{\begin{mdframed}[linecolor=importantline,linewidth=1ex,% { \begin{mdframed}[linecolor=importantline,linewidth=1ex,%
backgroundcolor=importantback,font={\sffamily}]% backgroundcolor=importantback,font={\sffamily}]%
\setlength{\parindent}{0pt}\setlength{\parskip}{1ex}}% \setlength{\parindent}{0pt}%
{\begin{mdframed}[linecolor=importantline,linewidth=1ex,% \setlength{\parskip}{1ex}%
}%
{ \begin{mdframed}[linecolor=importantline,linewidth=1ex,%
backgroundcolor=importantback,font={\sffamily},% backgroundcolor=importantback,font={\sffamily},%
frametitle={\captionof{iboxf}{#1}},frametitleaboveskip=-1ex,% frametitle={\captionof{iboxf}{#1}},frametitleaboveskip=-1ex,%
frametitlebackgroundcolor=importantline]% frametitlebackgroundcolor=importantline]%
\setlength{\parindent}{0pt}\setlength{\parskip}{1ex}}% \setlength{\parindent}{0pt}%
}% \setlength{\parskip}{1ex}%
{\end{mdframed}} }%
}%
{\end{mdframed}}
%%%%% hyperref %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%% hyperref %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage[bookmarks=true,bookmarksopen=true,% \usepackage[bookmarks=true,bookmarksopen=true,%
pdfpagemode=UseNone,pdfstartview=FitH,% pdfpagemode=UseNone,pdfstartview=FitH,%
plainpages=false,pdfpagelabels,% plainpages=false,pdfpagelabels,%

View File

@ -1,13 +1,13 @@
function m = mymedian( x ) function m = mymedian(x)
% returns the median of the vector x % returns the median of the vector x
xs = sort( x ); xs = sort(x);
if ( length( xs ) == 0 ) % empty input vector if length(xs) == 0 % empty input vector
m = NaN; m = NaN;
elseif ( rem( length( xs ), 2 ) == 0 ) % even number of data values elseif rem(length(xs), 2) == 0 % even number of data values
index = length( xs )/2; index = length(xs)/2;
m = (xs( index ) + xs( index+1 ))/2; % average the two central elements m = (xs(index) + xs(index+1))/2; % average the two central elements
else % odd number of data values else % odd number of data values
index = (length( xs ) + 1)/2; % take the middle element index = (length(xs) + 1)/2; % take the middle element
m = xs( index ); m = xs(index);
end end
end end