<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Matthias Pospiech</title>
	<atom:link href="http://www.matthiaspospiech.de/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.matthiaspospiech.de</link>
	<description></description>
	<lastBuildDate>Sun, 08 Jan 2012 16:47:39 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>Erstellung von Bachelor und Masterarbeiten mit LaTeX</title>
		<link>http://www.matthiaspospiech.de/blog/2011/12/09/erstellung-von-bachelor-und-masterarbeiten-mit-latex/</link>
		<comments>http://www.matthiaspospiech.de/blog/2011/12/09/erstellung-von-bachelor-und-masterarbeiten-mit-latex/#comments</comments>
		<pubDate>Fri, 09 Dec 2011 07:22:29 +0000</pubDate>
		<dc:creator>pospiech</dc:creator>
				<category><![CDATA[LaTeX]]></category>
		<category><![CDATA[Vortrag]]></category>

		<guid isPermaLink="false">http://www.matthiaspospiech.de/?p=625</guid>
		<description><![CDATA[Im Rahmen meiner Lehrverpflichtungen an der Leibniz Universit&#228;t Hannover habe ich die folgende Vorlesung zur Erstellung von Bachelor und Masterarbeiten mit LaTeX gehalten Die Verlesung richtetete sich an Studenten mit Vorkenntnissen in LaTeX, da die Inhalte hier die speziellen Probleme beim Schreiben von Abschlussarbeiten sein sollten. Effektiv habe ich aber auch grundlegende Kenntnisse wiederholt. Die [...]
<div class="related-posts">
<h4>Related Posts</h4>
<ol>
		<li><a href="http://www.matthiaspospiech.de/blog/2011/05/15/latex-einfuehrung/" rel="bookmark">LaTeX Einf&#252;hrung</a><!-- (12.4)--></li>
		<li><a href="http://www.matthiaspospiech.de/blog/2011/10/16/einfuhrung-in-bibliographien-mit-latex-biblatex-und-biber/" rel="bookmark">Einf&#252;hrung in Bibliographien mit LaTeX, biblatex und biber.</a><!-- (7.4)--></li>
		<li><a href="http://www.matthiaspospiech.de/blog/2007/08/08/latex-wiki/" rel="bookmark">LaTeX Wiki</a><!-- (7.1)--></li>
	</ol>
</div>
]]></description>
			<content:encoded><![CDATA[<p>Im Rahmen meiner Lehrverpflichtungen an der Leibniz Universit&#228;t Hannover habe ich die folgende Vorlesung zur Erstellung von Bachelor und Masterarbeiten mit LaTeX gehalten</p>
<ul>
	<li>Note: There is a file embedded within this post, please visit this post to download the file.</li>
	<li>Note: There is a file embedded within this post, please visit this post to download the file.</li>
</ul>

<p>Die Verlesung richtetete sich an Studenten mit Vorkenntnissen in LaTeX, da die Inhalte hier die speziellen Probleme beim Schreiben von Abschlussarbeiten sein sollten. Effektiv habe ich aber auch grundlegende Kenntnisse wiederholt. Die folgenden Kenntnisse wurde in der Vorlesungsank&#252;ndigung vorausgesetzt:</p> 
<ul>
	<li>Syntax von Klassen, Befehlen, Umgebungen und Sonderzeichen</li>
	<li>Grundlegende Pakete f&#252;r die Pr&#228;ambel (babel, inputenc, graphicx, amsmath, . . .).</li>
	<li>Textsatz (Kapitel, Abschnitte, Listen, Paragraphen)</li>
	<li>Mathematik: einzeilige Formeln</li>
	<li>Einbinden von Bildern</li>
	<li>einfache Tabellen</li>
</ul>

<p>Dementsprechend waren die teilnehmenden Studenten mehrheitlich am Ende ihres Bachelor oder Anfang des Masterstudiums. Die meisten kamen aus meiner Fakult&#228;t (Mathematik/Physik), aber es waren auch Informatiker und Lehramtstudenten dabei.</p>

<p>Voraussetzung f&#252;r den Kurs war eine vollst&#228;ndige Installation von Miktex 2.9 oder TeX Live 2011, sowie der Editor <a href="http://sourceforge.net/projects/texstudio/" class="liexternal">TexStudio</a>. Der Editor selber stellte f&#252;r keinen der Studenten ein Problem dar. Allerdings ist es empfehlenswert die voreingestellten Optionen anzupassen. Problematisch waren hingegen die Distributionen. Fast alle Studenten hatten nur die Minimalversion von Miktex installiert, die nicht ann&#228;hernd ausreicht. Und die Installation von TeXLive unter Linux, spezieller Ubunutu ist eine Katastrophe. Die Version der Distribution ist von 2009 und damit f&#252;r den Kurs nicht verwendbar, da ich siunitx und biblatex verwende. Eine manuelle Installation von der 2011er Version nach der <a href="http://www.tug.org/texlive/quickinstall.html" class="liexternal">Originalanleitung</a> funktioniert nicht. Man muss auf spezielle Ubunutu Anleitungen zur&#252;ckgreifen. Effektiv hatte die mehrheit der Studenten zu Beginn der Vorlesung ein nicht verwendbares LaTeX System.</p>

<p>Die Vorlesung umfasste 6 Vorlesungstermine mit jeweils 2-3 Zeitstunden. Die Inhalte waren:</p>

<ul>
	<li>Installation, Vorkenntnisse, Begriffe, Editor (TexStudio)</li>
	<li>Kapitel, &#220;berschriften, Paragraphen</li>
	<li>Strukturierung des Inhaltes</li>
	<li>Verweise</li>
	<li>Seitenlayout</li>
	<li>Aufteilung komplexer Dokumente</li>
	<li>Schriften</li>
	<li>Silbentrennung</li>
	<li>Literaturverzeichnis (mit biblatex und biber)</li>
	<li>Literatur erstellen und verwalten (JabRef)</li>
	<li>Mathematik und Einheiten (siunitx)</li>
	<li>Abbildungen und Beschriftungen</li>
	<li>Tabellen</li>
	<li>Fragen und Antworten</li>
	<li>sonstiges (tikz/pgf, pgfplots)</li>
</ul>




<div class="related-posts">
<h4>Related Posts</h4>
<ol>
		<li><a href="http://www.matthiaspospiech.de/blog/2011/05/15/latex-einfuehrung/" rel="bookmark">LaTeX Einf&#252;hrung</a><!-- (12.4)--></li>
		<li><a href="http://www.matthiaspospiech.de/blog/2011/10/16/einfuhrung-in-bibliographien-mit-latex-biblatex-und-biber/" rel="bookmark">Einf&#252;hrung in Bibliographien mit LaTeX, biblatex und biber.</a><!-- (7.4)--></li>
		<li><a href="http://www.matthiaspospiech.de/blog/2007/08/08/latex-wiki/" rel="bookmark">LaTeX Wiki</a><!-- (7.1)--></li>
	</ol>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.matthiaspospiech.de/blog/2011/12/09/erstellung-von-bachelor-und-masterarbeiten-mit-latex/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Einf&#252;hrung in Bibliographien mit LaTeX, biblatex und biber.</title>
		<link>http://www.matthiaspospiech.de/blog/2011/10/16/einfuhrung-in-bibliographien-mit-latex-biblatex-und-biber/</link>
		<comments>http://www.matthiaspospiech.de/blog/2011/10/16/einfuhrung-in-bibliographien-mit-latex-biblatex-und-biber/#comments</comments>
		<pubDate>Sun, 16 Oct 2011 11:24:25 +0000</pubDate>
		<dc:creator>pospiech</dc:creator>
				<category><![CDATA[LaTeX]]></category>
		<category><![CDATA[biber]]></category>
		<category><![CDATA[bibtex]]></category>
		<category><![CDATA[Word]]></category>

		<guid isPermaLink="false">http://www.matthiaspospiech.de/?p=622</guid>
		<description><![CDATA[Im Rahmen eines Arbeitsgruppenseminars der AG Morgner wurde der folgende Vortrag zur Einf&#252;hrung in Bibliographien mit LaTeX gehalten. Zielpublikum waren Masterstudenten und Doktoranden, die zuvor schon mit Bibtex gearbeitet hatten. Related Posts C++ Vortrag: Grundlagen und Objektorientierte Programmierung 2 Erstellung von Bachelor und Masterarbeiten mit LaTeX LaTeX Einf&#252;hrung
<div class="related-posts">
<h4>Related Posts</h4>
<ol>
		<li><a href="http://www.matthiaspospiech.de/blog/2010/09/07/c-vortrag-grundlagen-und-objektorientierte-programmierung-2/" rel="bookmark">C++ Vortrag: Grundlagen und Objektorientierte Programmierung 2</a><!-- (10.4)--></li>
		<li><a href="http://www.matthiaspospiech.de/blog/2011/12/09/erstellung-von-bachelor-und-masterarbeiten-mit-latex/" rel="bookmark">Erstellung von Bachelor und Masterarbeiten mit LaTeX</a><!-- (8.8)--></li>
		<li><a href="http://www.matthiaspospiech.de/blog/2011/05/15/latex-einfuehrung/" rel="bookmark">LaTeX Einf&#252;hrung</a><!-- (7.3)--></li>
	</ol>
</div>
]]></description>
			<content:encoded><![CDATA[<p>Im Rahmen eines Arbeitsgruppenseminars der 
<a href="http://www.iqo.uni-hannover.de/ultrafastlaseroptics.html" title="AG Morgner" class="liexternal">AG Morgner</a> 
wurde der folgende Vortrag zur Einf&#252;hrung in Bibliographien mit LaTeX gehalten. Zielpublikum 
waren Masterstudenten und Doktoranden, die zuvor schon mit Bibtex gearbeitet hatten.</p>
<ul>
	<li>Note: There is a file embedded within this post, please visit this post to download the file.</li>
	<li>Note: There is a file embedded within this post, please visit this post to download the file.</li>
</ul>


<div class="related-posts">
<h4>Related Posts</h4>
<ol>
		<li><a href="http://www.matthiaspospiech.de/blog/2010/09/07/c-vortrag-grundlagen-und-objektorientierte-programmierung-2/" rel="bookmark">C++ Vortrag: Grundlagen und Objektorientierte Programmierung 2</a><!-- (10.4)--></li>
		<li><a href="http://www.matthiaspospiech.de/blog/2011/12/09/erstellung-von-bachelor-und-masterarbeiten-mit-latex/" rel="bookmark">Erstellung von Bachelor und Masterarbeiten mit LaTeX</a><!-- (8.8)--></li>
		<li><a href="http://www.matthiaspospiech.de/blog/2011/05/15/latex-einfuehrung/" rel="bookmark">LaTeX Einf&#252;hrung</a><!-- (7.3)--></li>
	</ol>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.matthiaspospiech.de/blog/2011/10/16/einfuhrung-in-bibliographien-mit-latex-biblatex-und-biber/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>pcolor plots with publication ready formating</title>
		<link>http://www.matthiaspospiech.de/blog/2011/06/01/pcolor-plots-with-publication-ready-formating/</link>
		<comments>http://www.matthiaspospiech.de/blog/2011/06/01/pcolor-plots-with-publication-ready-formating/#comments</comments>
		<pubDate>Wed, 01 Jun 2011 06:34:01 +0000</pubDate>
		<dc:creator>pospiech</dc:creator>
				<category><![CDATA[matlab]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[pcolor]]></category>
		<category><![CDATA[plot]]></category>

		<guid isPermaLink="false">http://www.matthiaspospiech.de/?p=549</guid>
		<description><![CDATA[Matlab has many possibilities to create plots even fancy ones. However its defaults are very seldom suitable to use the plots directly for a publication. The following minimal code demonstrates how to generate a pcolor plot for 2D data with x- and y-axis. The data was calculated using the function shown here. pcolor&#40;xAxis, yAxis, Data2D&#41;; [...]
<div class="related-posts">
<h4>Related Posts</h4>
<ol>
		<li><a href="http://www.matthiaspospiech.de/blog/2011/05/31/fast-calculation-of-functions-with-two-variables/" rel="bookmark">fast calculation of functions with two variables</a><!-- (8.1)--></li>
		<li><a href="http://www.matthiaspospiech.de/blog/2011/05/31/plotting-a-filled-curve/" rel="bookmark">plotting a filled curve</a><!-- (5.8)--></li>
	</ol>
</div>
]]></description>
			<content:encoded><![CDATA[<p>Matlab has many possibilities to create plots even fancy ones. However its defaults are very seldom suitable to use the plots directly for a publication. The following minimal code demonstrates how to generate a pcolor plot for 2D data with x- and y-axis. The data was calculated using the function shown <a href="/blog/2011/05/31/fast-calculation-of-functions-with-two-variables/" class="liinternal">here</a>.</p>


<div class="wp_syntax"><div class="code"><pre class="matlab" style="font-family:monospace;"><span style="color: #0000FF;">pcolor</span><span style="color: #080;">&#40;</span>xAxis, yAxis, Data2D<span style="color: #080;">&#41;</span>; 
<span style="color: #0000FF;">shading</span> flat; <span style="color: #228B22;">% do not interpolate pixels</span>
<span style="color: #0000FF;">colorbar</span> <span style="color: #228B22;">% add colorbar</span>
&nbsp;
<span style="color: #0000FF;">xlabel</span><span style="color: #080;">&#40;</span><span style="color:#A020F0;">'x / µm'</span><span style="color: #080;">&#41;</span>;
<span style="color: #0000FF;">ylabel</span><span style="color: #080;">&#40;</span><span style="color:#A020F0;">'y / µm'</span><span style="color: #080;">&#41;</span>;</pre></div></div>




<a href="/files/matlab/plot/pcolor/pcolor-example-simple.png" class="shutterset_" title=''><img src='/files/matlab/plot/pcolor/thumbs/thumbs_pcolor-example-simple.png' alt='pcolor-example-simple' class='ngg-singlepic ngg-none' /></a>

<p>This however is not optimal. Font and fontsizes are not optimal, the color depth should be higher and tics are not shown anymore. Furthermore the colorbar should have an label as well.<p>
<p>The following code demonstrates a general approach how to solve all these problems and achieve directly a plot output which can be used directly for publications. The followin picture shows the resulting image:</p>

<a href="http://www.matthiaspospiech.de/files/matlab/plot/pcolor/pcolor-example.png" class="shutterset_" title=''><img src='http://www.matthiaspospiech.de/files/matlab/plot/pcolor/thumbs/thumbs_pcolor-example.png' alt='pcolor-example' class='ngg-singlepic ngg-none' /></a>
<span id="more-549"></span>
<p>First the environment is set up (not necessary if you just want to plot) and variables for plotting are defined.</p>


<div class="wp_syntax"><div class="code"><pre class="matlab" style="font-family:monospace;"><span style="color: #228B22;">% clear command window, figures and all variables</span>
<span style="color: #0000FF;">clc</span>; <span style="color: #0000FF;">clf</span>; <span style="color: #0000FF;">clear</span> <span style="color: #0000FF;">all</span>; 
&nbsp;
<span style="color: #228B22;">%% Common variables</span>
FontSize = <span style="color: #33f;">12</span>;
FontName = <span style="color:#A020F0;">'MyriadPro-Regular'</span>; <span style="color: #228B22;">% or choose any other font</span>
&nbsp;
doExportPlot = true;
languageEnglish = false;</pre></div></div>




<p>Next, the data for plotting is created. Here a <a href="/blog/2011/05/31/fast-calculation-of-functions-with-two-variables/" class="liinternal">previous shown example</a> is used</p>


<div class="wp_syntax"><div class="code"><pre class="matlab" style="font-family:monospace;"><span style="color: #228B22;">%% Calculation</span>
<span style="color: #228B22;">% calculate in single line (fastest method)</span>
xMat = <span style="color: #080;">&#40;</span>xAxis' * <span style="color: #0000FF;">ones</span><span style="color: #080;">&#40;</span><span style="color: #080;">&#91;</span><span style="color: #33f;">1</span> yPoints<span style="color: #080;">&#93;</span><span style="color: #080;">&#41;</span><span style="color: #080;">&#41;</span>';
yMat = yAxis' * <span style="color: #0000FF;">ones</span><span style="color: #080;">&#40;</span><span style="color: #080;">&#91;</span><span style="color: #33f;">1</span> xPoints<span style="color: #080;">&#93;</span><span style="color: #080;">&#41;</span>;
Data2D = Ripple<span style="color: #080;">&#40;</span>xMat, yMat<span style="color: #080;">&#41;</span>;
&nbsp;
Data2D = Data2D - <span style="color: #0000FF;">min</span><span style="color: #080;">&#40;</span><span style="color: #0000FF;">min</span><span style="color: #080;">&#40;</span>Data2D<span style="color: #080;">&#41;</span><span style="color: #080;">&#41;</span>; <span style="color: #228B22;">% normalize to 0-1</span>
Data2D = Data2D / <span style="color: #0000FF;">max</span><span style="color: #080;">&#40;</span><span style="color: #0000FF;">max</span><span style="color: #080;">&#40;</span>Data2D<span style="color: #080;">&#41;</span><span style="color: #080;">&#41;</span>;</pre></div></div>




<p>Then the plot window is opened and configured. Here a fixed size in cm is used. The z-buffer is used because opengl has rounding errors and should therefore be avoided if not necessary. Furthermore the position of the plot within the window is configured.</p>


<div class="wp_syntax"><div class="code"><pre class="matlab" style="font-family:monospace;"><span style="color: #228B22;">%% start plot</span>
&nbsp;
<span style="color: #228B22;">% figure dimensions in cm. I choose 1.5 or 2 times </span>
<span style="color: #228B22;">% the target size typically. If figure is display in</span>
<span style="color: #228B22;">% document much smaller increase the fontsize.</span>
&nbsp;
figure_width = <span style="color: #33f;">14</span>;  
figure_height = <span style="color: #33f;">10</span>;
&nbsp;
<span style="color: #228B22;">% --- setup plot windows</span>
figuresVisible = <span style="color:#A020F0;">'on'</span>; <span style="color: #228B22;">% 'off' for non displayed plots (will still be exported)</span>
hfig = <span style="color: #0000FF;">figure</span><span style="color: #080;">&#40;</span><span style="color: #33f;">1</span><span style="color: #080;">&#41;</span>; <span style="color: #0000FF;">clf</span>;
    <span style="color: #0000FF;">set</span><span style="color: #080;">&#40;</span>hfig,<span style="color:#A020F0;">'Visible'</span>, figuresVisible<span style="color: #080;">&#41;</span>
&nbsp;
    <span style="color: #0000FF;">set</span><span style="color: #080;">&#40;</span>hfig, <span style="color:#A020F0;">'units'</span>, <span style="color:#A020F0;">'centimeters'</span>, <span style="color:#A020F0;">'pos'</span>, <span style="color: #080;">&#91;</span><span style="color: #33f;">5</span> <span style="color: #33f;">5</span> figure_width figure_height<span style="color: #080;">&#93;</span><span style="color: #080;">&#41;</span>   
    <span style="color: #0000FF;">set</span><span style="color: #080;">&#40;</span>hfig, <span style="color:#A020F0;">'PaperPositionMode'</span>, <span style="color:#A020F0;">'auto'</span><span style="color: #080;">&#41;</span>;    
    <span style="color: #0000FF;">set</span><span style="color: #080;">&#40;</span>hfig, <span style="color:#A020F0;">'Renderer'</span>,<span style="color:#A020F0;">'Zbuffer'</span><span style="color: #080;">&#41;</span>; 
    <span style="color: #0000FF;">set</span><span style="color: #080;">&#40;</span>hfig, <span style="color:#A020F0;">'Color'</span>, <span style="color: #080;">&#91;</span><span style="color: #33f;">1</span> <span style="color: #33f;">1</span> <span style="color: #33f;">1</span><span style="color: #080;">&#93;</span><span style="color: #080;">&#41;</span>; <span style="color: #228B22;">% Sets figure background</span>
    <span style="color: #0000FF;">set</span><span style="color: #080;">&#40;</span><span style="color: #0000FF;">gca</span>, <span style="color:#A020F0;">'Color'</span>, <span style="color: #080;">&#91;</span><span style="color: #33f;">1</span> <span style="color: #33f;">1</span> <span style="color: #33f;">1</span><span style="color: #080;">&#93;</span><span style="color: #080;">&#41;</span>; <span style="color: #228B22;">% Sets axes background</span>
&nbsp;
<span style="color: #228B22;">% --- dimensions and position of plot </span>
hsp = <span style="color: #0000FF;">subplot</span><span style="color: #080;">&#40;</span><span style="color: #33f;">1</span>,<span style="color: #33f;">1</span>,<span style="color: #33f;">1</span>, <span style="color:#A020F0;">'Parent'</span>, hfig<span style="color: #080;">&#41;</span>;
<span style="color: #0000FF;">set</span><span style="color: #080;">&#40;</span>hsp,<span style="color:#A020F0;">'Position'</span>,<span style="color: #080;">&#91;</span><span style="color: #33f;">0.15</span> <span style="color: #33f;">0.17</span> <span style="color: #33f;">0.75</span> <span style="color: #33f;">0.80</span><span style="color: #080;">&#93;</span><span style="color: #080;">&#41;</span>;</pre></div></div>




<p>The actual plot is still a few lines:</p>


<div class="wp_syntax"><div class="code"><pre class="matlab" style="font-family:monospace;"><span style="color: #228B22;">%% plot</span>
colorDepth = <span style="color: #33f;">1000</span>;
<span style="color: #0000FF;">colormap</span><span style="color: #080;">&#40;</span><span style="color: #0000FF;">jet</span><span style="color: #080;">&#40;</span>colorDepth<span style="color: #080;">&#41;</span><span style="color: #080;">&#41;</span>;
<span style="color: #0000FF;">pcolor</span><span style="color: #080;">&#40;</span>xAxis, yAxis, Data2D<span style="color: #080;">&#41;</span>;</pre></div></div>




<p>Now the plot needs to be configured. First the pcolor must not have black lines between each data point (the plot would be black). This is achieved by setting the shading. In case of flat not interpolation is done. This might look nicer, but in case of scientific data is close to cheating. The axis properties are important, because matlab does not care itself about scaling. This means that the x- and y-axis might be square although the axis values have a factor of 1:10. The image ratio is set to the axis ratio by the property &#8216;image&#8217;. Additionally several properties for the figure can be set. Most important are the TickLength and the LineWidth.</p>


<div class="wp_syntax"><div class="code"><pre class="latex" style="font-family:monospace;"><span style="color: #2C922C; font-style: italic;">%%  setup axis plot properties</span>
<span style="color: #2C922C; font-style: italic;">% shading interp; % interpolate pixels</span>
shading flat; <span style="color: #2C922C; font-style: italic;">% do not interpolate pixels</span>
axis on;      <span style="color: #2C922C; font-style: italic;">% display axis</span>
axis tight;   <span style="color: #2C922C; font-style: italic;">% no white borders</span>
axis image;   <span style="color: #2C922C; font-style: italic;">% real x,y scaling</span>
&nbsp;
set(gca, ...
    'CLim' , <span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">0 1</span><span style="color: #E02020; ">]</span>, ...
    'Box'         , 'on'      , ...
    'TickDir'     , 'in'      , ...
    'TickLength'  , <span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">.015 .015</span><span style="color: #E02020; ">]</span> , ...
    'XMinorTick'  , 'off'      , ...
    'YMinorTick'  , 'off'     , ...
    'XGrid'       , 'off'     , ...
    'YGrid'       , 'off'     , ...
    'XColor'      , <span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">.0 .0 .0</span><span style="color: #E02020; ">]</span>, ...
    'YColor'      , <span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">.0 .0 .0</span><span style="color: #E02020; ">]</span>, ...
    'LineWidth'   , 0.6        );</pre></div></div>




<p>optionally the axis ticks can be configured </p>


<div class="wp_syntax"><div class="code"><pre class="matlab" style="font-family:monospace;"><span style="color: #228B22;">%% axis ticks</span>
<span style="color: #0000FF;">set</span><span style="color: #080;">&#40;</span><span style="color: #0000FF;">gca</span>,<span style="color:#A020F0;">'XTick'</span>,-<span style="color: #33f;">15</span>:<span style="color: #33f;">5</span>:<span style="color: #33f;">15</span><span style="color: #080;">&#41;</span>
<span style="color: #0000FF;">set</span><span style="color: #080;">&#40;</span><span style="color: #0000FF;">gca</span>,<span style="color:#A020F0;">'YTick'</span>,-<span style="color: #33f;">10</span>:<span style="color: #33f;">5</span>:<span style="color: #33f;">10</span><span style="color: #080;">&#41;</span></pre></div></div>




<p>Next the axis labels are set up. Here I define them in both german end english. That has the advantage, that I can create the figure easily in both languages. The labels are all set with saving of handles, to be able to configure them later.</p>


<div class="wp_syntax"><div class="code"><pre class="latex" style="font-family:monospace;"><span style="color: #2C922C; font-style: italic;">%% label texts</span>
TITLE = '';
if (languageEnglish)
    xLabelText = 'x / µm';  
    yLabelText = 'y / µm';
    zLabelText = 'normalized intensity';
else
    xLabelText = 'x / µm';
    yLabelText = 'y / µm';
    zLabelText = 'normierte Intensität';
end
&nbsp;
<span style="color: #2C922C; font-style: italic;">% save handles to set up label properties</span>
hTitle = title(TITLE);
hXLabel = xlabel(xLabelText);
hYLabel = ylabel(yLabelText);</pre></div></div>




<p>The colorbar is still missing. Here a label and ticks are defined, and the TickLength and LineWidth is configured.</p>


<div class="wp_syntax"><div class="code"><pre class="matlab" style="font-family:monospace;"><span style="color: #228B22;">%% colorbar</span>
<span style="color: #0000FF;">caxis</span><span style="color: #080;">&#40;</span><span style="color: #080;">&#91;</span><span style="color: #33f;">0</span> <span style="color: #33f;">1</span><span style="color: #080;">&#93;</span><span style="color: #080;">&#41;</span>;
hcb = <span style="color: #0000FF;">colorbar</span><span style="color: #080;">&#40;</span><span style="color:#A020F0;">'location'</span>,<span style="color:#A020F0;">'EastOutside'</span><span style="color: #080;">&#41;</span>;
hcLabel = <span style="color: #0000FF;">ylabel</span><span style="color: #080;">&#40;</span>hcb,zLabelText<span style="color: #080;">&#41;</span>;
<span style="color: #0000FF;">set</span><span style="color: #080;">&#40;</span>hcb,<span style="color:#A020F0;">'YTickLabel'</span>,<span style="color: #33f;">0</span>:<span style="color: #33f;">0.2</span>:<span style="color: #33f;">1</span>, <span style="color:#A020F0;">'Ytick'</span>, <span style="color: #33f;">0</span>:<span style="color: #33f;">0.2</span>:<span style="color: #33f;">1</span><span style="color: #080;">&#41;</span>
<span style="color: #0000FF;">set</span><span style="color: #080;">&#40;</span>hcb,<span style="color:#A020F0;">'YTickMode'</span>,<span style="color:#A020F0;">'manual'</span><span style="color: #080;">&#41;</span>
<span style="color: #0000FF;">set</span><span style="color: #080;">&#40;</span>hcb, <span style="color: #080;">...</span>
  <span style="color:#A020F0;">'Box'</span>         , <span style="color:#A020F0;">'on'</span>     , <span style="color: #080;">...</span>
  <span style="color:#A020F0;">'TickDir'</span>     , <span style="color:#A020F0;">'in'</span>     , <span style="color: #080;">...</span>
  <span style="color:#A020F0;">'TickLength'</span>  , <span style="color: #080;">&#91;</span>.015 .015<span style="color: #080;">&#93;</span> , <span style="color: #080;">...</span>
  <span style="color:#A020F0;">'LineWidth'</span>   , <span style="color: #33f;">0.6</span><span style="color: #080;">&#41;</span>;</pre></div></div>




<p>Last all handles need to be configured. Basically that means setting up the fonts for all.</p>


<div class="wp_syntax"><div class="code"><pre class="matlab" style="font-family:monospace;"><span style="color: #228B22;">%% set properties for all handles</span>
<span style="color: #0000FF;">set</span><span style="color: #080;">&#40;</span><span style="color: #080;">&#91;</span><span style="color: #0000FF;">gca</span>, hcb, hTitle, hXLabel, hYLabel, hcLabel<span style="color: #080;">&#93;</span>, <span style="color: #080;">...</span>
    <span style="color:#A020F0;">'FontSize'</span>   , FontSize    , <span style="color: #080;">...</span>
    <span style="color:#A020F0;">'FontName'</span>   , FontName<span style="color: #080;">&#41;</span>;</pre></div></div>




<p>And finally some bugs need to be fixed. fixLabels changes the decimal point character to &#8216;,&#8217; (see below) and the last line brings the tics to the top again, which are overwritten by matlab.</p>


<div class="wp_syntax"><div class="code"><pre class="matlab" style="font-family:monospace;"><span style="color: #228B22;">%% last 'bug' fixes</span>
&nbsp;
<span style="color: #228B22;">% change decimal point to ',' for german text</span>
<span style="color: #0000FF;">if</span> <span style="color: #080;">&#40;</span>~languageEnglish<span style="color: #080;">&#41;</span>
     fixLabels<span style="color: #080;">&#40;</span><span style="color: #0000FF;">gca</span><span style="color: #080;">&#41;</span>;
     fixLabels<span style="color: #080;">&#40;</span>hcb<span style="color: #080;">&#41;</span>;
<span style="color: #0000FF;">end</span>
<span style="color: #228B22;">% bring axis on top again (fix matlab bug)</span>
<span style="color: #0000FF;">set</span><span style="color: #080;">&#40;</span><span style="color: #0000FF;">gca</span>,<span style="color:#A020F0;">'Layer'</span>, <span style="color:#A020F0;">'top'</span><span style="color: #080;">&#41;</span>;</pre></div></div>




fixLabels (not optimal, be nevertheless working):


<div class="wp_syntax"><div class="code"><pre class="latex" style="font-family:monospace;">function fixLabels( axis )
&nbsp;
xlabels = get(axis, 'XTickLabel');
for k=1:size(xlabels,1)
    xlabels(k,:) = strrep(xlabels(k,:), '.', ',');
end
set(axis, 'XTickLabel', xlabels);
&nbsp;
ylabels = get(axis, 'YTickLabel');
for k=1:size(ylabels,1)
    ylabels(k,:) = strrep(ylabels(k,:), '.', ',');
end
set(axis, 'YTickLabel', ylabels);
&nbsp;
set(axis, 'XTickMode', 'manual');
set(axis, 'YTickMode', 'manual');
&nbsp;
end</pre></div></div>




<p>In the end we might want to export the plot. Here the printing is done to a png file with a resolution of 400 dpi. Since matlab is not filling the plot window and large white borders might surround the actual plot, the png file is cropped using the <a href="http://www.mathworks.com/matlabcentral/fileexchange/20427-crop-whitespace-from-an-image" class="liexternal">crop function</a> by Andrew Bliss.</p>


<div class="wp_syntax"><div class="code"><pre class="matlab" style="font-family:monospace;"><span style="color: #228B22;">%% export</span>
<span style="color: #0000FF;">drawnow</span>
&nbsp;
SaveDir = <span style="color:#A020F0;">''</span>;
SaveName = <span style="color:#A020F0;">'pcolor-example'</span>;
&nbsp;
<span style="color: #0000FF;">if</span> <span style="color: #080;">&#40;</span>doExportPlot<span style="color: #080;">&#41;</span>
    IMAGENAME = <span style="color: #080;">&#91;</span>SaveDir SaveName<span style="color: #080;">&#93;</span>; 
    <span style="color: #0000FF;">print</span><span style="color: #080;">&#40;</span>hfig, <span style="color: #080;">&#91;</span><span style="color:#A020F0;">'-r'</span> <span style="color: #0000FF;">num2str</span><span style="color: #080;">&#40;</span><span style="color: #33f;">400</span><span style="color: #080;">&#41;</span><span style="color: #080;">&#93;</span>, <span style="color: #080;">&#91;</span>IMAGENAME <span style="color:#A020F0;">'.png'</span> <span style="color: #080;">&#93;</span>, <span style="color: #080;">&#91;</span><span style="color:#A020F0;">'-d'</span> <span style="color:#A020F0;">'png'</span><span style="color: #080;">&#93;</span><span style="color: #080;">&#41;</span>;    
    crop<span style="color: #080;">&#40;</span><span style="color: #080;">&#91;</span>IMAGENAME <span style="color:#A020F0;">'.png'</span><span style="color: #080;">&#93;</span><span style="color: #080;">&#41;</span>;
    display<span style="color: #080;">&#40;</span><span style="color:#A020F0;">'finished plot export'</span><span style="color: #080;">&#41;</span>
<span style="color: #0000FF;">end</span>
&nbsp;
<span style="color: #228B22;">% close(hfig);</span></pre></div></div>




Download the complete file: Note: There is a file embedded within this post, please visit this post to download the file.
<div class="related-posts">
<h4>Related Posts</h4>
<ol>
		<li><a href="http://www.matthiaspospiech.de/blog/2011/05/31/fast-calculation-of-functions-with-two-variables/" rel="bookmark">fast calculation of functions with two variables</a><!-- (8.1)--></li>
		<li><a href="http://www.matthiaspospiech.de/blog/2011/05/31/plotting-a-filled-curve/" rel="bookmark">plotting a filled curve</a><!-- (5.8)--></li>
	</ol>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.matthiaspospiech.de/blog/2011/06/01/pcolor-plots-with-publication-ready-formating/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>fast calculation of functions with two variables</title>
		<link>http://www.matthiaspospiech.de/blog/2011/05/31/fast-calculation-of-functions-with-two-variables/</link>
		<comments>http://www.matthiaspospiech.de/blog/2011/05/31/fast-calculation-of-functions-with-two-variables/#comments</comments>
		<pubDate>Tue, 31 May 2011 21:05:40 +0000</pubDate>
		<dc:creator>pospiech</dc:creator>
				<category><![CDATA[matlab]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[fast]]></category>
		<category><![CDATA[functions]]></category>
		<category><![CDATA[matrix]]></category>

		<guid isPermaLink="false">http://www.matthiaspospiech.de/?p=545</guid>
		<description><![CDATA[If you come from the programming world of C/C++ or java or any other traditional programming languages you might fall into the trap of using for loops for the calculation of functions. This works as expected but it is much slower than what matlab can do. The following example demonstrates this principle (which you should [...]
<div class="related-posts">
<h4>Related Posts</h4>
<ol>
		<li><a href="http://www.matthiaspospiech.de/blog/2011/06/01/pcolor-plots-with-publication-ready-formating/" rel="bookmark">pcolor plots with publication ready formating</a><!-- (12.6)--></li>
		<li><a href="http://www.matthiaspospiech.de/blog/2011/05/31/fast-reading-of-structured-text-data-with-matlab/" rel="bookmark">fast reading of structured text data with matlab</a><!-- (8.1)--></li>
	</ol>
</div>
]]></description>
			<content:encoded><![CDATA[<p>If you come from the programming world of C/C++ or java or any other traditional programming languages you might fall into the trap of using for loops for the calculation of functions. This works as expected but it is much slower than what matlab can do. The following example demonstrates this principle (which you should not use if you can)</p>


<div class="wp_syntax"><div class="code"><pre class="matlab" style="font-family:monospace;">Data2D = <span style="color: #0000FF;">zeros</span><span style="color: #080;">&#40;</span><span style="color: #080;">&#91;</span>xPoints yPoints<span style="color: #080;">&#93;</span><span style="color: #080;">&#41;</span>;
<span style="color: #0000FF;">for</span> xi = <span style="color: #33f;">1</span>:xPoints
    x = xAxis<span style="color: #080;">&#40;</span>xi<span style="color: #080;">&#41;</span>;
    <span style="color: #0000FF;">for</span> yi = <span style="color: #33f;">1</span>:yPoints        
        y = yAxis<span style="color: #080;">&#40;</span>yi<span style="color: #080;">&#41;</span>;
        Data2D<span style="color: #080;">&#40;</span>xi,yi<span style="color: #080;">&#41;</span> = Ripple<span style="color: #080;">&#40;</span>x, y<span style="color: #080;">&#41;</span>;
    <span style="color: #0000FF;">end</span>
<span style="color: #0000FF;">end</span></pre></div></div>



<p>On my computer it takes 10.3 seconds for 1.000.000 datapoints.</p>

<p>If the function depends on a single variable one should use a vector and for two variables one should use matrices instead. The following example demonstrates how to calculate a functions with two variables in a single step:</p>


<div class="wp_syntax"><div class="code"><pre class="matlab" style="font-family:monospace;">xMat = <span style="color: #080;">&#40;</span>xAxis' * <span style="color: #0000FF;">ones</span><span style="color: #080;">&#40;</span><span style="color: #080;">&#91;</span><span style="color: #33f;">1</span> yPoints<span style="color: #080;">&#93;</span><span style="color: #080;">&#41;</span><span style="color: #080;">&#41;</span>';
yMat = yAxis' * <span style="color: #0000FF;">ones</span><span style="color: #080;">&#40;</span><span style="color: #080;">&#91;</span><span style="color: #33f;">1</span> xPoints<span style="color: #080;">&#93;</span><span style="color: #080;">&#41;</span>;
Data2D = Ripple<span style="color: #080;">&#40;</span>xMat, yMat<span style="color: #080;">&#41;</span>;</pre></div></div>



<p>On my computer it takes 0.12 seconds for 1.000.000 datapoints, which is approx 90 times faster.</p>
<span id="more-545"></span>
<p>This is the complete code that was used</p>


<div class="wp_syntax"><div class="code"><pre class="matlab" style="font-family:monospace;"><span style="color: #228B22;">% clear command window, figures and all variables</span>
<span style="color: #0000FF;">clc</span>; <span style="color: #0000FF;">clf</span>; <span style="color: #0000FF;">clear</span> <span style="color: #0000FF;">all</span>; 
&nbsp;
<span style="color: #228B22;">%% Definition of calculation constants</span>
&nbsp;
<span style="color: #228B22;">% calculation of axis</span>
xMax = <span style="color: #33f;">15</span>;
xPoints = <span style="color: #33f;">1000</span>;
xAxis = <span style="color: #0000FF;">linspace</span><span style="color: #080;">&#40;</span>-xMax, xMax, xPoints<span style="color: #080;">&#41;</span>;
&nbsp;
yMax = <span style="color: #33f;">12</span>;
yPoints = <span style="color: #33f;">1000</span>;
yAxis = <span style="color: #0000FF;">linspace</span><span style="color: #080;">&#40;</span>-yMax, yMax, yPoints<span style="color: #080;">&#41;</span>;
&nbsp;
<span style="color: #228B22;">%% function, here inline since it is rather simple</span>
Ripple = @<span style="color: #080;">&#40;</span>x,y<span style="color: #080;">&#41;</span> <span style="color: #080;">&#40;</span> <span style="color: #080;">&#40;</span><span style="color: #0000FF;">cos</span><span style="color: #080;">&#40;</span><span style="color: #0000FF;">sqrt</span><span style="color: #080;">&#40;</span>x.*x+y.*y<span style="color: #080;">&#41;</span> + <span style="color: #0000FF;">cos</span><span style="color: #080;">&#40;</span><span style="color: #0000FF;">sqrt</span><span style="color: #080;">&#40;</span><span style="color: #080;">&#40;</span><span style="color: #080;">&#40;</span>x+.913*<span style="color: #33f;">2</span>*<span style="color: #0000FF;">pi</span><span style="color: #080;">&#41;</span>.*<span style="color: #080;">&#40;</span>x+.913*<span style="color: #33f;">2</span>*<span style="color: #0000FF;">pi</span><span style="color: #080;">&#41;</span><span style="color: #080;">&#41;</span>+y.*y<span style="color: #080;">&#41;</span><span style="color: #080;">&#41;</span> + <span style="color: #0000FF;">cos</span><span style="color: #080;">&#40;</span><span style="color: #0000FF;">sqrt</span><span style="color: #080;">&#40;</span><span style="color: #080;">&#40;</span><span style="color: #080;">&#40;</span>x-.913*<span style="color: #33f;">2</span>*<span style="color: #0000FF;">pi</span><span style="color: #080;">&#41;</span>.*<span style="color: #080;">&#40;</span>x-.913*<span style="color: #33f;">2</span>*<span style="color: #0000FF;">pi</span><span style="color: #080;">&#41;</span><span style="color: #080;">&#41;</span>+<span style="color: #080;">&#40;</span>y.*y<span style="color: #080;">&#41;</span><span style="color: #080;">&#41;</span><span style="color: #080;">&#41;</span><span style="color: #080;">&#41;</span>*<span style="color: #33f;">4</span><span style="color: #080;">&#41;</span> <span style="color: #080;">&#41;</span>;
&nbsp;
<span style="color: #228B22;">%% Calculation</span>
<span style="color: #228B22;">% calculate in single line (fastest method)</span>
xMat = <span style="color: #080;">&#40;</span>xAxis' * <span style="color: #0000FF;">ones</span><span style="color: #080;">&#40;</span><span style="color: #080;">&#91;</span><span style="color: #33f;">1</span> yPoints<span style="color: #080;">&#93;</span><span style="color: #080;">&#41;</span><span style="color: #080;">&#41;</span>';
yMat = yAxis' * <span style="color: #0000FF;">ones</span><span style="color: #080;">&#40;</span><span style="color: #080;">&#91;</span><span style="color: #33f;">1</span> xPoints<span style="color: #080;">&#93;</span><span style="color: #080;">&#41;</span>;
<span style="color: #0000FF;">tic</span>;
Data2D = Ripple<span style="color: #080;">&#40;</span>xMat, yMat<span style="color: #080;">&#41;</span>;
display<span style="color: #080;">&#40;</span><span style="color: #080;">&#91;</span><span style="color:#A020F0;">'calculated '</span> <span style="color: #0000FF;">num2str</span><span style="color: #080;">&#40;</span>xPoints*yPoints<span style="color: #080;">&#41;</span> <span style="color:#A020F0;">' datapoints in '</span> <span style="color: #0000FF;">num2str</span><span style="color: #080;">&#40;</span><span style="color: #0000FF;">toc</span><span style="color: #080;">&#41;</span> <span style="color:#A020F0;">' seconds'</span><span style="color: #080;">&#93;</span><span style="color: #080;">&#41;</span>;
&nbsp;
Data2D = Data2D / <span style="color: #0000FF;">max</span><span style="color: #080;">&#40;</span><span style="color: #0000FF;">max</span><span style="color: #080;">&#40;</span>Data2D<span style="color: #080;">&#41;</span><span style="color: #080;">&#41;</span>; <span style="color: #228B22;">% normalize</span></pre></div></div>



<div class="related-posts">
<h4>Related Posts</h4>
<ol>
		<li><a href="http://www.matthiaspospiech.de/blog/2011/06/01/pcolor-plots-with-publication-ready-formating/" rel="bookmark">pcolor plots with publication ready formating</a><!-- (12.6)--></li>
		<li><a href="http://www.matthiaspospiech.de/blog/2011/05/31/fast-reading-of-structured-text-data-with-matlab/" rel="bookmark">fast reading of structured text data with matlab</a><!-- (8.1)--></li>
	</ol>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.matthiaspospiech.de/blog/2011/05/31/fast-calculation-of-functions-with-two-variables/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>plotting a filled curve</title>
		<link>http://www.matthiaspospiech.de/blog/2011/05/31/plotting-a-filled-curve/</link>
		<comments>http://www.matthiaspospiech.de/blog/2011/05/31/plotting-a-filled-curve/#comments</comments>
		<pubDate>Tue, 31 May 2011 20:23:44 +0000</pubDate>
		<dc:creator>pospiech</dc:creator>
				<category><![CDATA[matlab]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[area]]></category>
		<category><![CDATA[fill]]></category>
		<category><![CDATA[plot]]></category>

		<guid isPermaLink="false">http://www.matthiaspospiech.de/?p=543</guid>
		<description><![CDATA[A search on how to fill the area under a curve reveals that such questions are quite often asked. Here is the solution in a function file that I created for simplifying filled curve plots using matlabs fill function. function handle = filledcurve&#40;x, y, zero, colorspec&#41; &#160; if &#40;nargin &#60; 3&#41; zero = 0; end [...]
<div class="related-posts">
<h4>Related Posts</h4>
<ol>
		<li><a href="http://www.matthiaspospiech.de/blog/2011/06/01/pcolor-plots-with-publication-ready-formating/" rel="bookmark">pcolor plots with publication ready formating</a><!-- (7.4)--></li>
		<li><a href="http://www.matthiaspospiech.de/blog/2010/12/16/plotting-tutorials/" rel="bookmark">plotting tutorials</a><!-- (5.6)--></li>
	</ol>
</div>
]]></description>
			<content:encoded><![CDATA[<p>A search on how to fill the area under a curve reveals that such questions are quite often asked. Here is the solution in a function file that I created for simplifying filled curve plots using matlabs fill function.</p>


<div class="wp_syntax"><div class="code"><pre class="matlab" style="font-family:monospace;"><span style="color: #0000FF;">function</span> handle = filledcurve<span style="color: #080;">&#40;</span>x, y, zero, colorspec<span style="color: #080;">&#41;</span>
&nbsp;
<span style="color: #0000FF;">if</span> <span style="color: #080;">&#40;</span><span style="color: #0000FF;">nargin</span> &lt; <span style="color: #33f;">3</span><span style="color: #080;">&#41;</span>
    zero = <span style="color: #33f;">0</span>;
<span style="color: #0000FF;">end</span>
&nbsp;
<span style="color: #0000FF;">if</span> <span style="color: #080;">&#40;</span><span style="color: #0000FF;">nargin</span> &lt; <span style="color: #33f;">4</span><span style="color: #080;">&#41;</span>
    colorspec = <span style="color:#A020F0;">'b'</span>;
<span style="color: #0000FF;">end</span>
&nbsp;
&nbsp;
xtemp = <span style="color: #080;">&#91;</span>x<span style="color: #080;">&#40;</span><span style="color: #33f;">1</span><span style="color: #080;">&#41;</span> ; x<span style="color: #080;">&#40;</span>:<span style="color: #080;">&#41;</span> ; x<span style="color: #080;">&#40;</span><span style="color: #0000FF;">end</span><span style="color: #080;">&#41;</span><span style="color: #080;">&#93;</span> ;
ytemp = <span style="color: #080;">&#91;</span>zero ; y<span style="color: #080;">&#40;</span>:<span style="color: #080;">&#41;</span> ; zero <span style="color: #080;">&#93;</span> ;
&nbsp;
<span style="color: #228B22;">% plot</span>
handle = <span style="color: #0000FF;">fill</span><span style="color: #080;">&#40;</span>xtemp,ytemp,colorspec<span style="color: #080;">&#41;</span>;</pre></div></div>




<div class="related-posts">
<h4>Related Posts</h4>
<ol>
		<li><a href="http://www.matthiaspospiech.de/blog/2011/06/01/pcolor-plots-with-publication-ready-formating/" rel="bookmark">pcolor plots with publication ready formating</a><!-- (7.4)--></li>
		<li><a href="http://www.matthiaspospiech.de/blog/2010/12/16/plotting-tutorials/" rel="bookmark">plotting tutorials</a><!-- (5.6)--></li>
	</ol>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.matthiaspospiech.de/blog/2011/05/31/plotting-a-filled-curve/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>fast reading of structured text data with matlab</title>
		<link>http://www.matthiaspospiech.de/blog/2011/05/31/fast-reading-of-structured-text-data-with-matlab/</link>
		<comments>http://www.matthiaspospiech.de/blog/2011/05/31/fast-reading-of-structured-text-data-with-matlab/#comments</comments>
		<pubDate>Tue, 31 May 2011 20:18:08 +0000</pubDate>
		<dc:creator>pospiech</dc:creator>
				<category><![CDATA[matlab]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[read]]></category>
		<category><![CDATA[textfile]]></category>

		<guid isPermaLink="false">http://www.matthiaspospiech.de/?p=538</guid>
		<description><![CDATA[In the following I present a solution to read data from a textfile which has the number of x-values (columns) in the first line, the number of y-values (rows) in the second line and in all following lines the matrix with size x times y. The principle reading of the data is achieved by the [...]
<div class="related-posts">
<h4>Related Posts</h4>
<ol>
		<li><a href="http://www.matthiaspospiech.de/blog/2011/05/31/fast-calculation-of-functions-with-two-variables/" rel="bookmark">fast calculation of functions with two variables</a><!-- (8.1)--></li>
		<li><a href="http://www.matthiaspospiech.de/blog/2010/10/11/matlab-figures-solving-export-problems/" rel="bookmark">Matlab figures &#8211; solving export problems</a><!-- (7.9)--></li>
		<li><a href="http://www.matthiaspospiech.de/blog/2011/06/01/pcolor-plots-with-publication-ready-formating/" rel="bookmark">pcolor plots with publication ready formating</a><!-- (6.8)--></li>
	</ol>
</div>
]]></description>
			<content:encoded><![CDATA[<p>In the following I present a solution to read data from a textfile which has the number of x-values (columns) in the first line, the number of y-values (rows) in the second line and in all following lines the matrix with size x times y.</p>

<p>The principle reading of the data is achieved by the following code</p>


<div class="wp_syntax"><div class="code"><pre class="matlab" style="font-family:monospace;"><span style="color: #228B22;">% open file</span>
display<span style="color: #080;">&#40;</span><span style="color: #080;">&#91;</span><span style="color:#A020F0;">'reading '</span> FILENAME<span style="color: #080;">&#93;</span><span style="color: #080;">&#41;</span>;
fid = <span style="color: #0000FF;">fopen</span><span style="color: #080;">&#40;</span>FILENAME, <span style="color:#A020F0;">'r'</span><span style="color: #080;">&#41;</span>;
<span style="color: #0000FF;">fseek</span><span style="color: #080;">&#40;</span>fid, <span style="color: #33f;">0</span>, <span style="color:#A020F0;">'bof'</span><span style="color: #080;">&#41;</span>;
&nbsp;
<span style="color: #228B22;">% read single line: number of x-values</span>
tline = <span style="color: #0000FF;">fgetl</span><span style="color: #080;">&#40;</span>fid<span style="color: #080;">&#41;</span>;
valueLine = <span style="color: #0000FF;">strrep</span><span style="color: #080;">&#40;</span>tline, <span style="color:#A020F0;">'#'</span>, <span style="color:#A020F0;">''</span><span style="color: #080;">&#41;</span>;
valueLine = <span style="color: #0000FF;">strrep</span><span style="color: #080;">&#40;</span>valueLine, <span style="color:#A020F0;">' '</span>, <span style="color:#A020F0;">''</span><span style="color: #080;">&#41;</span>;
x = <span style="color: #0000FF;">str2double</span><span style="color: #080;">&#40;</span>valueLine<span style="color: #080;">&#41;</span>;
&nbsp;
<span style="color: #228B22;">% read single line: number of y-values</span>
tline = <span style="color: #0000FF;">fgetl</span><span style="color: #080;">&#40;</span>fid<span style="color: #080;">&#41;</span>;
valueLine = <span style="color: #0000FF;">strrep</span><span style="color: #080;">&#40;</span>tline, <span style="color:#A020F0;">'#'</span>, <span style="color:#A020F0;">''</span><span style="color: #080;">&#41;</span>;
valueLine = <span style="color: #0000FF;">strrep</span><span style="color: #080;">&#40;</span>valueLine, <span style="color:#A020F0;">' '</span>, <span style="color:#A020F0;">''</span><span style="color: #080;">&#41;</span>;
y = <span style="color: #0000FF;">str2double</span><span style="color: #080;">&#40;</span>valueLine<span style="color: #080;">&#41;</span>;
&nbsp;
<span style="color: #228B22;">% read full matrix with size x * y</span>
DATACELL = textscan<span style="color: #080;">&#40;</span>fid,<span style="color:#A020F0;">'%f'</span>,<span style="color: #080;">&#91;</span>x,y<span style="color: #080;">&#93;</span><span style="color: #080;">&#41;</span>;
DATA = DATACELL<span style="color: #080;">&#123;</span><span style="color: #33f;">1</span><span style="color: #080;">&#125;</span>;
&nbsp;
<span style="color: #228B22;">% convert data to correct matrix format</span>
DATA = <span style="color: #0000FF;">reshape</span><span style="color: #080;">&#40;</span>DATA, y, x<span style="color: #080;">&#41;</span>;
&nbsp;
<span style="color: #228B22;">% close file</span>
<span style="color: #0000FF;">fclose</span><span style="color: #080;">&#40;</span>fid<span style="color: #080;">&#41;</span>;</pre></div></div>



<span id="more-538"></span>

<p>This can however be slow, especially for matrices with text-file size of several hundred MB. Since disk space is usually not a limit an time much more expensive than disk space I save the data again in matlabs binary format. If I have to read the file a second time I can read the matlab file instead which is 10-100 times faster. Additionally If the data of the file is requested a second time 
this can be skipped if the data is kept persistent in the function reading the data. In total this is achieved with the following code:</p>


<div class="wp_syntax"><div class="code"><pre class="matlab" style="font-family:monospace;"><span style="color: #0000FF;">function</span> <span style="color: #080;">&#91;</span>r_Data, r_xsize, r_ysize<span style="color: #080;">&#93;</span> = ReadSimulationData<span style="color: #080;">&#40;</span>FILENAME<span style="color: #080;">&#41;</span>
&nbsp;
<span style="color: #0000FF;">persistent</span> lastImageName;
<span style="color: #0000FF;">persistent</span> DATA;
<span style="color: #0000FF;">persistent</span> xsize;
<span style="color: #0000FF;">persistent</span> ysize;
&nbsp;
<span style="color: #228B22;">% if this file is equal to last file reuse data</span>
<span style="color: #0000FF;">if</span> <span style="color: #080;">&#40;</span>not<span style="color: #080;">&#40;</span>isempty<span style="color: #080;">&#40;</span>lastImageName<span style="color: #080;">&#41;</span><span style="color: #080;">&#41;</span> &amp;&amp; <span style="color: #080;">&#40;</span><span style="color: #0000FF;">strcmp</span><span style="color: #080;">&#40;</span>lastImageName,FILENAME<span style="color: #080;">&#41;</span><span style="color: #080;">&#41;</span><span style="color: #080;">&#41;</span>
    display<span style="color: #080;">&#40;</span><span style="color: #080;">&#91;</span><span style="color:#A020F0;">'using '</span> FILENAME<span style="color: #080;">&#93;</span><span style="color: #080;">&#41;</span>;
<span style="color: #0000FF;">else</span>
    <span style="color: #228B22;">% check if converted matlab file exists</span>
    MatlabDataName = <span style="color: #0000FF;">strrep</span><span style="color: #080;">&#40;</span>FILENAME, <span style="color:#A020F0;">'.txt'</span>, <span style="color:#A020F0;">'.mat'</span><span style="color: #080;">&#41;</span>;
    <span style="color: #0000FF;">if</span> <span style="color: #080;">&#40;</span><span style="color: #0000FF;">exist</span><span style="color: #080;">&#40;</span>MatlabDataName, <span style="color:#A020F0;">'file'</span><span style="color: #080;">&#41;</span><span style="color: #080;">&#41;</span>
        display<span style="color: #080;">&#40;</span><span style="color: #080;">&#91;</span><span style="color:#A020F0;">'loading '</span> MatlabDataName<span style="color: #080;">&#93;</span><span style="color: #080;">&#41;</span>;
        <span style="color: #0000FF;">load</span><span style="color: #080;">&#40;</span>MatlabDataName, <span style="color:#A020F0;">'-mat'</span>, <span style="color:#A020F0;">'DATA'</span>, <span style="color:#A020F0;">'xsize'</span>, <span style="color:#A020F0;">'ysize'</span><span style="color: #080;">&#41;</span>;
    <span style="color: #0000FF;">else</span>                
        <span style="color: #228B22;">%% read data from file</span>
&nbsp;
        <span style="color: #228B22;">% open file</span>
        display<span style="color: #080;">&#40;</span><span style="color: #080;">&#91;</span><span style="color:#A020F0;">'reading '</span> FILENAME<span style="color: #080;">&#93;</span><span style="color: #080;">&#41;</span>;
        fid = <span style="color: #0000FF;">fopen</span><span style="color: #080;">&#40;</span>FILENAME, <span style="color:#A020F0;">'r'</span><span style="color: #080;">&#41;</span>;
        <span style="color: #0000FF;">fseek</span><span style="color: #080;">&#40;</span>fid, <span style="color: #33f;">0</span>, <span style="color:#A020F0;">'bof'</span><span style="color: #080;">&#41;</span>;
&nbsp;
        <span style="color: #228B22;">% read single line: number of x-values</span>
        tline = <span style="color: #0000FF;">fgetl</span><span style="color: #080;">&#40;</span>fid<span style="color: #080;">&#41;</span>;
        valueLine = <span style="color: #0000FF;">strrep</span><span style="color: #080;">&#40;</span>tline, <span style="color:#A020F0;">'#'</span>, <span style="color:#A020F0;">''</span><span style="color: #080;">&#41;</span>;
        valueLine = <span style="color: #0000FF;">strrep</span><span style="color: #080;">&#40;</span>valueLine, <span style="color:#A020F0;">' '</span>, <span style="color:#A020F0;">''</span><span style="color: #080;">&#41;</span>;
        x = <span style="color: #0000FF;">str2double</span><span style="color: #080;">&#40;</span>valueLine<span style="color: #080;">&#41;</span>;
&nbsp;
        <span style="color: #228B22;">% read single line: number of y-values</span>
        tline = <span style="color: #0000FF;">fgetl</span><span style="color: #080;">&#40;</span>fid<span style="color: #080;">&#41;</span>;
        valueLine = <span style="color: #0000FF;">strrep</span><span style="color: #080;">&#40;</span>tline, <span style="color:#A020F0;">'#'</span>, <span style="color:#A020F0;">''</span><span style="color: #080;">&#41;</span>;
        valueLine = <span style="color: #0000FF;">strrep</span><span style="color: #080;">&#40;</span>valueLine, <span style="color:#A020F0;">' '</span>, <span style="color:#A020F0;">''</span><span style="color: #080;">&#41;</span>;
        y = <span style="color: #0000FF;">str2double</span><span style="color: #080;">&#40;</span>valueLine<span style="color: #080;">&#41;</span>;
&nbsp;
        <span style="color: #228B22;">% read full matrix with size x * y</span>
        DATACELL = textscan<span style="color: #080;">&#40;</span>fid,<span style="color:#A020F0;">'%f'</span>,<span style="color: #080;">&#91;</span>x,y<span style="color: #080;">&#93;</span><span style="color: #080;">&#41;</span>;
        DATA = DATACELL<span style="color: #080;">&#123;</span><span style="color: #33f;">1</span><span style="color: #080;">&#125;</span>;
&nbsp;
        <span style="color: #228B22;">% check if read length is equal</span>
        <span style="color: #228B22;">% to expected length.</span>
        <span style="color: #228B22;">% if not resize x accordingly</span>
        <span style="color: #228B22;">% (typically not necessary)</span>
        lengthdiff = <span style="color: #0000FF;">length</span><span style="color: #080;">&#40;</span>DATA<span style="color: #080;">&#41;</span> - x*y;
        <span style="color: #0000FF;">if</span> <span style="color: #080;">&#40;</span>lengthdiff ~= <span style="color: #33f;">0</span><span style="color: #080;">&#41;</span>
            x = x + lengthdiff/y;
        <span style="color: #0000FF;">end</span>
        <span style="color: #228B22;">% convert data to correct matrix format</span>
        DATA = <span style="color: #0000FF;">reshape</span><span style="color: #080;">&#40;</span>DATA, y, x<span style="color: #080;">&#41;</span>;
&nbsp;
        <span style="color: #228B22;">% close file</span>
        <span style="color: #0000FF;">fclose</span><span style="color: #080;">&#40;</span>fid<span style="color: #080;">&#41;</span>;
&nbsp;
        <span style="color: #228B22;">% save last read filename</span>
        lastImageName = FILENAME;        
&nbsp;
        xsize = x;
        ysize = y;
        display<span style="color: #080;">&#40;</span><span style="color: #080;">&#91;</span><span style="color:#A020F0;">'saving '</span> MatlabDataName<span style="color: #080;">&#93;</span><span style="color: #080;">&#41;</span>;
&nbsp;
        <span style="color: #228B22;">% save data in binary format</span>
        <span style="color: #228B22;">% this speeds up reading of big matrices</span>
        <span style="color: #228B22;">% enormously</span>
        <span style="color: #0000FF;">save</span><span style="color: #080;">&#40;</span>MatlabDataName, <span style="color:#A020F0;">'DATA'</span>, <span style="color:#A020F0;">'xsize'</span>, <span style="color:#A020F0;">'ysize'</span>, <span style="color:#A020F0;">'-mat'</span><span style="color: #080;">&#41;</span>;        
    <span style="color: #0000FF;">end</span>
<span style="color: #0000FF;">end</span>
&nbsp;
<span style="color: #228B22;">% copy read, or old persistent data to</span>
<span style="color: #228B22;">% return data values</span>
r_Data = DATA;
r_xsize = xsize;
r_ysize = ysize;
&nbsp;
<span style="color: #0000FF;">return</span>;</pre></div></div>






<div class="related-posts">
<h4>Related Posts</h4>
<ol>
		<li><a href="http://www.matthiaspospiech.de/blog/2011/05/31/fast-calculation-of-functions-with-two-variables/" rel="bookmark">fast calculation of functions with two variables</a><!-- (8.1)--></li>
		<li><a href="http://www.matthiaspospiech.de/blog/2010/10/11/matlab-figures-solving-export-problems/" rel="bookmark">Matlab figures &#8211; solving export problems</a><!-- (7.9)--></li>
		<li><a href="http://www.matthiaspospiech.de/blog/2011/06/01/pcolor-plots-with-publication-ready-formating/" rel="bookmark">pcolor plots with publication ready formating</a><!-- (6.8)--></li>
	</ol>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.matthiaspospiech.de/blog/2011/05/31/fast-reading-of-structured-text-data-with-matlab/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>LaTeX-Vorlage f&#252;r Protokolle</title>
		<link>http://www.matthiaspospiech.de/blog/2011/05/15/latex-vorlage-fuer-protokolle/</link>
		<comments>http://www.matthiaspospiech.de/blog/2011/05/15/latex-vorlage-fuer-protokolle/#comments</comments>
		<pubDate>Sun, 15 May 2011 21:08:45 +0000</pubDate>
		<dc:creator>pospiech</dc:creator>
				<category><![CDATA[LaTeX]]></category>
		<category><![CDATA[Protokoll]]></category>
		<category><![CDATA[Vorlage]]></category>

		<guid isPermaLink="false">http://www.matthiaspospiech.de/?p=534</guid>
		<description><![CDATA[Neue LaTeX-Vorlage zur Erstellung von Labor-Protokollen: Die Vorlage beruht auf Koma Script (scrartcl) und ist f&#252;r pdflatex ausgelegt (kein LuaTeX oder XeteX). Unter anderem werden diese Pakete verwendet: inputenc, grffile, fontenc, textcomp, lmodern, babel, xcolor, graphicx, epstopdf, caption, amsmath, siunitx, booktabs, tabularx, setspace, scrpage2, microtype. Anpassungen im Layout wurden mit koma script Optionen sowie den [...]
<div class="related-posts">
<h4>Related Posts</h4>
<ol>
		<li><a href="http://www.matthiaspospiech.de/blog/2007/06/25/syntaxhighlighting-von-latex-in-webseiten/" rel="bookmark">Syntaxhighlighting von LaTeX in Webseiten</a><!-- (11.5)--></li>
		<li><a href="http://www.matthiaspospiech.de/blog/2008/08/04/alternatives-syntaxhighlighting/" rel="bookmark">Alternatives Syntaxhighlighting</a><!-- (10.3)--></li>
		<li><a href="http://www.matthiaspospiech.de/blog/2011/12/09/erstellung-von-bachelor-und-masterarbeiten-mit-latex/" rel="bookmark">Erstellung von Bachelor und Masterarbeiten mit LaTeX</a><!-- (10.2)--></li>
	</ol>
</div>
]]></description>
			<content:encoded><![CDATA[<p>Neue LaTeX-Vorlage zur Erstellung von Labor-Protokollen:</p>
Note: There is a file embedded within this post, please visit this post to download the file.

<p>Die Vorlage beruht auf Koma Script (scrartcl) und ist f&#252;r pdflatex ausgelegt (kein LuaTeX oder XeteX).
Unter anderem werden diese Pakete verwendet: inputenc, grffile, fontenc, textcomp, lmodern, babel, xcolor, graphicx, epstopdf, caption, amsmath, siunitx, booktabs, tabularx, setspace, scrpage2, microtype. Anpassungen im Layout wurden mit koma script Optionen sowie den Einstellungsm&#246;glichkeiten der Pakete caption und scrpage2 vorgenommen.</p>

<div class="related-posts">
<h4>Related Posts</h4>
<ol>
		<li><a href="http://www.matthiaspospiech.de/blog/2007/06/25/syntaxhighlighting-von-latex-in-webseiten/" rel="bookmark">Syntaxhighlighting von LaTeX in Webseiten</a><!-- (11.5)--></li>
		<li><a href="http://www.matthiaspospiech.de/blog/2008/08/04/alternatives-syntaxhighlighting/" rel="bookmark">Alternatives Syntaxhighlighting</a><!-- (10.3)--></li>
		<li><a href="http://www.matthiaspospiech.de/blog/2011/12/09/erstellung-von-bachelor-und-masterarbeiten-mit-latex/" rel="bookmark">Erstellung von Bachelor und Masterarbeiten mit LaTeX</a><!-- (10.2)--></li>
	</ol>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.matthiaspospiech.de/blog/2011/05/15/latex-vorlage-fuer-protokolle/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>LaTeX Einf&#252;hrung</title>
		<link>http://www.matthiaspospiech.de/blog/2011/05/15/latex-einfuehrung/</link>
		<comments>http://www.matthiaspospiech.de/blog/2011/05/15/latex-einfuehrung/#comments</comments>
		<pubDate>Sun, 15 May 2011 16:44:24 +0000</pubDate>
		<dc:creator>pospiech</dc:creator>
				<category><![CDATA[LaTeX]]></category>
		<category><![CDATA[Einführung]]></category>
		<category><![CDATA[Vortrag]]></category>

		<guid isPermaLink="false">http://www.matthiaspospiech.de/?p=528</guid>
		<description><![CDATA[Im Rahmen eines Workshops der jDPG Hannover wurde der folgende Vortrag zur Einf&#252;hrung in LaTeX gehalten: Das Publikum bestand aus Physik-Studenten des 2ten Semesters. Der Vortrag und die dazu abgehaltenen &#220;bungen umfassten 4 Stunden. Dieser Zeitraum reichte aus, um grundlegende Konzepte zu erkl&#228;ren, allerdings nicht um alle ben&#246;tigten Inhalte zum Schreiben einer Abschlussarbeit zu behandeln. [...]
<div class="related-posts">
<h4>Related Posts</h4>
<ol>
		<li><a href="http://www.matthiaspospiech.de/blog/2011/12/09/erstellung-von-bachelor-und-masterarbeiten-mit-latex/" rel="bookmark">Erstellung von Bachelor und Masterarbeiten mit LaTeX</a><!-- (11.2)--></li>
		<li><a href="http://www.matthiaspospiech.de/blog/2007/08/08/latex-wiki/" rel="bookmark">LaTeX Wiki</a><!-- (6.4)--></li>
		<li><a href="http://www.matthiaspospiech.de/blog/2011/10/16/einfuhrung-in-bibliographien-mit-latex-biblatex-und-biber/" rel="bookmark">Einf&#252;hrung in Bibliographien mit LaTeX, biblatex und biber.</a><!-- (6.4)--></li>
	</ol>
</div>
]]></description>
			<content:encoded><![CDATA[<p>Im Rahmen eines Workshops der <a href="http://www.dpg-physik.de/dpg/gliederung/junge/rg/hannover/index.html" class="liexternal">jDPG Hannover</a> wurde der folgende Vortrag zur Einf&#252;hrung in LaTeX gehalten:</p>
<ul>
	<li>Note: There is a file embedded within this post, please visit this post to download the file.</li>
	<li>Note: There is a file embedded within this post, please visit this post to download the file.</li>
	<li>Note: There is a file embedded within this post, please visit this post to download the file.</li>
</ul>

<p>Das Publikum bestand aus Physik-Studenten des 2ten Semesters. Der Vortrag und die dazu abgehaltenen &#220;bungen umfassten 4 Stunden. Dieser Zeitraum reichte aus, um grundlegende Konzepte zu erkl&#228;ren, allerdings nicht um alle ben&#246;tigten Inhalte zum Schreiben einer Abschlussarbeit zu behandeln. Insbesondere Labels/Referenzen, Zitate und Literaturverzeichnisse sowie die Strukturierung in verschiedene Dokumente mit <code>\input</code> bzw <code>\include</code> war in diesem Zeitrahmen nicht mehr m&#246;glich. Das Ziele war allerdings auch zun&#228;chst die Studenten zu bef&#228;higen 3-5 seitige Praktikumsberichte anzufertigen, wof&#252;r diese Inhalte nicht ben&#246;tigt werden.</p>

<p>Voraussetzung f&#252;r den Kurs war eine vollst&#228;ndige Installation von Miktex 2.9 oder TeX Live 2010, sowie der Editor <a href="http://texmakerx.sourceforge.net/" class="liexternal">TexMakerX</a>. Im vorangegangenen Jahr war TeXnicCenter als Editor verwendet worden, was aber dazu gef&#252;hrt hatte, dass viele Studenten prim&#228;r Probleme mit dem Editor hatte. Derartige Probleme konnten diesmal nicht beobachtet werden. Interessanterweise war der Tabellenassistent von besonderem Interesse. </p>

In den &#220;bungen hatten die Studenten, soweit ich das mitbekommen habe, die folgenden Probleme:
<ul>
	<li>Der Unterschied in den Optionen zwischen article und scrartcl war verwirrend. Da ich nicht auf die Analyse von Fehlermeldungen im Vortrag eingegangen bin, hatten die Studenten auch nicht auf die Warnungen geachtet (&#8216;unused option&#8217;).</li>
	<li>Da <code>\text</code>, <code>\mathrm</code> und <code>\si</code> (siunitx) im Mathematikmodus aufrechte Schriften erzeugen wurde der Unterschied zwischen den Befehlen nicht klar.</li>
</ul>

Konzeptionell w&#252;rde ich beim n&#228;chsten Mal, sofern mehr Zeit zur Verf&#252;gung steht
<ul>
	<li>den grundlegenden Umgang mit einem Texteditor mit Tastaturkommandos &#252;ben lassen,</li>
	<li>den Unterschied zwischen Distribution und Editor st&#228;rker hervorheben (wie auch immer), </li>
	<li>das Verstehen von Fehlermeldungen und das Erstellen eines Minimalbeispiels behandeln </li>
	<li>sowie das Auffinden und gezielte Lesen von Dokumentationen ein&#252;ben.</li>
</ul>

<div class="related-posts">
<h4>Related Posts</h4>
<ol>
		<li><a href="http://www.matthiaspospiech.de/blog/2011/12/09/erstellung-von-bachelor-und-masterarbeiten-mit-latex/" rel="bookmark">Erstellung von Bachelor und Masterarbeiten mit LaTeX</a><!-- (11.2)--></li>
		<li><a href="http://www.matthiaspospiech.de/blog/2007/08/08/latex-wiki/" rel="bookmark">LaTeX Wiki</a><!-- (6.4)--></li>
		<li><a href="http://www.matthiaspospiech.de/blog/2011/10/16/einfuhrung-in-bibliographien-mit-latex-biblatex-und-biber/" rel="bookmark">Einf&#252;hrung in Bibliographien mit LaTeX, biblatex und biber.</a><!-- (6.4)--></li>
	</ol>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.matthiaspospiech.de/blog/2011/05/15/latex-einfuehrung/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>plotting tutorials</title>
		<link>http://www.matthiaspospiech.de/blog/2010/12/16/plotting-tutorials/</link>
		<comments>http://www.matthiaspospiech.de/blog/2010/12/16/plotting-tutorials/#comments</comments>
		<pubDate>Thu, 16 Dec 2010 07:37:46 +0000</pubDate>
		<dc:creator>pospiech</dc:creator>
				<category><![CDATA[matlab]]></category>

		<guid isPermaLink="false">http://www.matthiaspospiech.de/?p=521</guid>
		<description><![CDATA[Here are some tutorials about plotting in matlab: plotting in matlab making pretty graphs tutorials on many other topics can be found at http://www.advancedmcode.org/. Related Posts plotting a filled curve
<div class="related-posts">
<h4>Related Posts</h4>
<ol>
		<li><a href="http://www.matthiaspospiech.de/blog/2011/05/31/plotting-a-filled-curve/" rel="bookmark">plotting a filled curve</a><!-- (6.6)--></li>
	</ol>
</div>
]]></description>
			<content:encoded><![CDATA[Here are some tutorials about plotting in matlab:
<ul>
	<li><a href="http://www.advancedmcode.org/plotting-in-matlab.html" class="liexternal">plotting in matlab</a></li>
	<li><a href="http://blogs.mathworks.com/loren/2007/12/11/making-pretty-graphs/" class="liexternal">making pretty graphs</a></li>
</ul>
tutorials on many other topics can be found at <a href="http://www.advancedmcode.org/" class="liexternal">http://www.advancedmcode.org/</a>.
<div class="related-posts">
<h4>Related Posts</h4>
<ol>
		<li><a href="http://www.matthiaspospiech.de/blog/2011/05/31/plotting-a-filled-curve/" rel="bookmark">plotting a filled curve</a><!-- (6.6)--></li>
	</ol>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.matthiaspospiech.de/blog/2010/12/16/plotting-tutorials/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>batch script for automatic backup using winrar</title>
		<link>http://www.matthiaspospiech.de/blog/2010/10/24/batch-script-for-automatic-backup-using-winrar/</link>
		<comments>http://www.matthiaspospiech.de/blog/2010/10/24/batch-script-for-automatic-backup-using-winrar/#comments</comments>
		<pubDate>Sun, 24 Oct 2010 14:01:15 +0000</pubDate>
		<dc:creator>pospiech</dc:creator>
				<category><![CDATA[batch]]></category>

		<guid isPermaLink="false">http://www.matthiaspospiech.de/?p=515</guid>
		<description><![CDATA[For a regular full backup of all my important data I am using a bash script on Linux. This is now an example to achieve the same under Windows 7 using batch scripting and winrar as the compressor. Zip files can not be used since this is limited in total number of files which I [...]
<div class="related-posts">
<h4>Related Posts</h4>
<ol>
		<li><a href="http://www.matthiaspospiech.de/blog/2007/04/02/local-network-shares-with-linux/" rel="bookmark">Local network shares with linux</a><!-- (8.3)--></li>
		<li><a href="http://www.matthiaspospiech.de/blog/2007/04/03/restore-some-configuration-files/" rel="bookmark">Restore some configuration files</a><!-- (7.6)--></li>
		<li><a href="http://www.matthiaspospiech.de/blog/2007/03/31/bash-copy-everthing-except/" rel="bookmark">bash: Copy everthing except &#8230;</a><!-- (7.4)--></li>
	</ol>
</div>
]]></description>
			<content:encoded><![CDATA[<p>For a regular full backup of all my important data I am using a bash script on Linux. This is now an example to achieve the same under Windows 7 using batch scripting and winrar as the compressor. Zip files can not be used since this is limited in total number of files which I typically overcome.</p>


<div class="wp_syntax"><div class="code"><pre class="dos" style="font-family:monospace;"><span style="color: #33cc33;">@</span><span style="color: #b1b100; font-weight: bold;">ECHO</span> OFF
cls
<span style="color: #b100b1; font-style: italic;">::-------------------------------------------------------------------------------------</span>
<span style="color: #b1b100; font-weight: bold;">SET</span> PACKER=&quot;c:\Program Files\WinRAR\RAR.exe&quot;
<span style="color: #b100b1; font-style: italic;">
:: %APPDATA% = &quot;C:\Users\Matthias\AppData\Roaming&quot;</span>
<span style="color: #b100b1; font-style: italic;">:: %USERNAME% = &quot;Matthias&quot;</span>
<span style="color: #b100b1; font-style: italic;">:: %HOMEPATH% = &quot;Users\Matthias&quot;</span>
<span style="color: #b100b1; font-style: italic;">:: %HOMEDRIVE% = &quot;C:\&quot;</span>
<span style="color: #b1b100; font-weight: bold;">SET</span> DIRUSER=&quot;<span style="color: #33cc33;">%</span><span style="color: #448888;">HOMEDRIVE</span><span style="color: #33cc33;">%%</span><span style="color: #448888;">HOMEPATH</span><span style="color: #33cc33;">%</span>&quot;
<span style="color: #b1b100; font-weight: bold;">SET</span> DIRUSERDOC=&quot;<span style="color: #33cc33;">%</span><span style="color: #448888;">DIRUSER</span><span style="color: #33cc33;">%</span>\Documents&quot;
<span style="color: #b100b1; font-style: italic;">::SET SAVEDIR=&quot;c:\temp\%DATE%\&quot;</span>
<span style="color: #b1b100; font-weight: bold;">SET</span> SAVEDIR=&quot;Y:\<span style="color: #33cc33;">%</span><span style="color: #448888;">DATE</span><span style="color: #33cc33;">%</span>&quot;
<span style="color: #00b100; font-weight: bold;">call</span>:funcCreateDir <span style="color: #33cc33;">%</span><span style="color: #448888;">SAVEDIR</span><span style="color: #33cc33;">%</span>
<span style="color: #b100b1; font-style: italic;">
&nbsp;
::--------------------------------------------------------</span>
<span style="color: #b100b1; font-style: italic;">:: --- MAIN ----------------------------------------------</span>
<span style="color: #b100b1; font-style: italic;">::--------------------------------------------------------</span>
<span style="color: #b100b1; font-style: italic;">
::Backup home:AppData:Thunderbird</span>
	<span style="color: #b1b100; font-weight: bold;">SET</span> TARGET=&quot;<span style="color: #33cc33;">%</span><span style="color: #448888;">SAVEDIR</span><span style="color: #33cc33;">%</span>\Win7.AppData.Thunderbird.rar&quot;
	<span style="color: #b1b100; font-weight: bold;">SET</span> FILES=&quot;<span style="color: #33cc33;">%</span><span style="color: #448888;">APPDATA</span><span style="color: #33cc33;">%</span>\Thunderbird\*&quot;
<span style="color: #b100b1; font-style: italic;">	::call:funcBackup %TARGET% %FILES%</span>
<span style="color: #b100b1; font-style: italic;">
::Backup home:User (without AppData, Documents and other real data)</span>
	<span style="color: #b1b100; font-weight: bold;">SET</span> TARGET=&quot;<span style="color: #33cc33;">%</span><span style="color: #448888;">SAVEDIR</span><span style="color: #33cc33;">%</span>\Win7.User.Matthias.rar&quot;
	<span style="color: #b1b100; font-weight: bold;">SET</span> FILES=&quot;<span style="color: #33cc33;">%</span><span style="color: #448888;">DIRUSER</span><span style="color: #33cc33;">%</span>\*&quot;
	<span style="color: #b1b100; font-weight: bold;">SET</span> EXLUCDE=&quot;-x<span style="color: #33cc33;">%</span><span style="color: #448888;">DIRUSER</span><span style="color: #33cc33;">%</span>\AppData -x<span style="color: #33cc33;">%</span><span style="color: #448888;">DIRUSER</span><span style="color: #33cc33;">%</span>\Downloads -x<span style="color: #33cc33;">%</span><span style="color: #448888;">DIRUSER</span><span style="color: #33cc33;">%</span>\Pictures -x<span style="color: #33cc33;">%</span><span style="color: #448888;">DIRUSER</span><span style="color: #33cc33;">%</span>\Documents -x<span style="color: #33cc33;">%</span><span style="color: #448888;">DIRUSER</span><span style="color: #33cc33;">%</span>\Music -x<span style="color: #33cc33;">%</span><span style="color: #448888;">DIRUSER</span><span style="color: #33cc33;">%</span>\Videos &quot; 
<span style="color: #b100b1; font-style: italic;">	::call:funcBackup %TARGET% %FILES% %EXLUCDE%</span>
<span style="color: #b100b1; font-style: italic;">
::Backup home:User:Documents</span>
	<span style="color: #b1b100; font-weight: bold;">SET</span> TARGET=&quot;<span style="color: #33cc33;">%</span><span style="color: #448888;">SAVEDIR</span><span style="color: #33cc33;">%</span>\Win7.User.Matthias.Documents.rar&quot;
	<span style="color: #b1b100; font-weight: bold;">SET</span> FILES=&quot;<span style="color: #33cc33;">%</span><span style="color: #448888;">DIRUSER</span><span style="color: #33cc33;">%</span>\Documents&quot;		
	<span style="color: #b1b100; font-weight: bold;">SET</span> EXLUCDE=&quot;-x<span style="color: #33cc33;">%</span><span style="color: #448888;">DIRUSER</span><span style="color: #33cc33;">%</span>\Documents\SVN&quot; 
	<span style="color: #00b100; font-weight: bold;">call</span>:funcBackup <span style="color: #33cc33;">%</span><span style="color: #448888;">TARGET</span><span style="color: #33cc33;">%</span> <span style="color: #33cc33;">%</span><span style="color: #448888;">FILES</span><span style="color: #33cc33;">%</span> <span style="color: #33cc33;">%</span><span style="color: #448888;">EXLUCDE</span><span style="color: #33cc33;">%</span>
<span style="color: #b100b1; font-style: italic;">	
::Backup system:Fonts	</span>
	<span style="color: #b1b100; font-weight: bold;">SET</span> TARGET=&quot;<span style="color: #33cc33;">%</span><span style="color: #448888;">SAVEDIR</span><span style="color: #33cc33;">%</span>\Win7.Fonts.rar&quot;
	<span style="color: #b1b100; font-weight: bold;">SET</span> FILES=&quot;<span style="color: #33cc33;">%</span><span style="color: #448888;">WINDIR</span><span style="color: #33cc33;">%</span>\Fonts\*&quot;
<span style="color: #b100b1; font-style: italic;">	::call:funcBackup %TARGET% %FILES%</span>
<span style="color: #b100b1; font-style: italic;">	
::Backup latex:texmf</span>
	<span style="color: #b1b100; font-weight: bold;">SET</span> TARGET=&quot;<span style="color: #33cc33;">%</span><span style="color: #448888;">SAVEDIR</span><span style="color: #33cc33;">%</span>\Win7.localtexmf.rar&quot;
	<span style="color: #b1b100; font-weight: bold;">SET</span> FILES=&quot;c:\localtexmf\*&quot;
<span style="color: #b100b1; font-style: italic;">	::call:funcBackup %TARGET% %FILES%</span>
<span style="color: #b100b1; font-style: italic;">
::Backup home:AppData (without Thunderbird)</span>
	<span style="color: #b1b100; font-weight: bold;">SET</span> TARGET=&quot;<span style="color: #33cc33;">%</span><span style="color: #448888;">SAVEDIR</span><span style="color: #33cc33;">%</span>\Win7.AppData.rar&quot;
	<span style="color: #b1b100; font-weight: bold;">SET</span> FILES=&quot;<span style="color: #33cc33;">%</span><span style="color: #448888;">DIRUSER</span><span style="color: #33cc33;">%</span>\AppData\*&quot;
	<span style="color: #b1b100; font-weight: bold;">SET</span> EXLUCDE=&quot;-x<span style="color: #33cc33;">%</span><span style="color: #448888;">APPDATA</span><span style="color: #33cc33;">%</span>\Thunderbird&quot;
<span style="color: #b100b1; font-style: italic;">	::call:funcBackup %TARGET% %FILES% %EXLUCDE%</span>
&nbsp;
<span style="color: #b1b100; font-weight: bold;">echo</span>.<span style="color: #33cc33;">&amp;</span>pause<span style="color: #33cc33;">&amp;</span><span style="color: #00b100; font-weight: bold;">goto</span>:eof
<span style="color: #b100b1; font-style: italic;">
::--------------------------------------------------------</span>
<span style="color: #b100b1; font-style: italic;">::-- Function section starts below here</span>
<span style="color: #b100b1; font-style: italic;">::--------------------------------------------------------</span>
&nbsp;
:<span style="color: #b100b1; font-weight: bold;">funcBackup</span>
	<span style="color: #b1b100; font-weight: bold;">SET</span> TARGET=<span style="color: #33cc33;">%</span><span style="color: #448888;">~1</span>
	<span style="color: #b1b100; font-weight: bold;">SET</span> FILES=<span style="color: #33cc33;">%</span><span style="color: #448888;">~2</span>
	<span style="color: #b1b100; font-weight: bold;">SET</span> EXCLUDE=<span style="color: #33cc33;">%</span><span style="color: #448888;">~3</span>
	<span style="color: #b1b100; font-weight: bold;">echo</span>.&quot;<span style="color: #33cc33;">%</span><span style="color: #448888;">PACKER</span><span style="color: #33cc33;">%</span> a -r <span style="color: #33cc33;">%</span><span style="color: #448888;">EXCLUDE</span><span style="color: #33cc33;">%</span> <span style="color: #33cc33;">%</span><span style="color: #448888;">TARGET</span><span style="color: #33cc33;">%</span> <span style="color: #33cc33;">%</span><span style="color: #448888;">FILES</span><span style="color: #33cc33;">%</span>&quot;
	<span style="color: #00b100; font-weight: bold;">call</span> <span style="color: #33cc33;">%</span><span style="color: #448888;">PACKER</span><span style="color: #33cc33;">%</span> a -r <span style="color: #33cc33;">%</span><span style="color: #448888;">EXCLUDE</span><span style="color: #33cc33;">%</span> <span style="color: #33cc33;">%</span><span style="color: #448888;">TARGET</span><span style="color: #33cc33;">%</span> <span style="color: #33cc33;">%</span><span style="color: #448888;">FILES</span><span style="color: #33cc33;">%</span>
<span style="color: #00b100; font-weight: bold;">goto</span>:eof
&nbsp;
:<span style="color: #b100b1; font-weight: bold;">funcCreateDir</span>
	<span style="color: #b1b100; font-weight: bold;">echo</span> &quot;creating <span style="color: #33cc33;">%</span><span style="color: #448888;">~1</span>&quot;
	<span style="color: #00b100; font-weight: bold;">IF</span> <span style="color: #000000; font-weight: bold;">NOT</span> <span style="color: #000000; font-weight: bold;">EXIST</span> &quot;<span style="color: #33cc33;">%</span><span style="color: #448888;">~1</span>&quot; <span style="color: #b1b100; font-weight: bold;">md</span> &quot;<span style="color: #33cc33;">%</span><span style="color: #448888;">~1</span>&quot;
<span style="color: #00b100; font-weight: bold;">goto</span>:eof</pre></div></div>



<div class="related-posts">
<h4>Related Posts</h4>
<ol>
		<li><a href="http://www.matthiaspospiech.de/blog/2007/04/02/local-network-shares-with-linux/" rel="bookmark">Local network shares with linux</a><!-- (8.3)--></li>
		<li><a href="http://www.matthiaspospiech.de/blog/2007/04/03/restore-some-configuration-files/" rel="bookmark">Restore some configuration files</a><!-- (7.6)--></li>
		<li><a href="http://www.matthiaspospiech.de/blog/2007/03/31/bash-copy-everthing-except/" rel="bookmark">bash: Copy everthing except &#8230;</a><!-- (7.4)--></li>
	</ol>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.matthiaspospiech.de/blog/2010/10/24/batch-script-for-automatic-backup-using-winrar/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic page generated in 2.412 seconds. -->
<!-- Cached page generated by WP-Super-Cache on 2012-01-24 18:22:52 -->

