<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://mscneuro.neuro.uni-bremen.de/index.php?action=history&amp;feed=atom&amp;title=Basic_Commands_and_Variables</id>
	<title>Basic Commands and Variables - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://mscneuro.neuro.uni-bremen.de/index.php?action=history&amp;feed=atom&amp;title=Basic_Commands_and_Variables"/>
	<link rel="alternate" type="text/html" href="https://mscneuro.neuro.uni-bremen.de/index.php?title=Basic_Commands_and_Variables&amp;action=history"/>
	<updated>2026-06-02T08:49:59Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.5</generator>
	<entry>
		<id>https://mscneuro.neuro.uni-bremen.de/index.php?title=Basic_Commands_and_Variables&amp;diff=648&amp;oldid=prev</id>
		<title>Davrot: /* Operations */</title>
		<link rel="alternate" type="text/html" href="https://mscneuro.neuro.uni-bremen.de/index.php?title=Basic_Commands_and_Variables&amp;diff=648&amp;oldid=prev"/>
		<updated>2025-10-23T13:56:36Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;Operations&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 13:56, 23 October 2025&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l131&quot;&gt;Line 131:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 131:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The basic arithmetic operations like addition (+), subtraction (-), multiplication (*), division (/) and powers (^) are defined in a natural manner. Examples using the earlier defined variables are&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The basic arithmetic operations like addition (+), subtraction (-), multiplication (*), division (/) and powers (^) are defined in a natural manner. Examples using the earlier defined variables are&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;code&amp;gt;z = 10-8;&amp;lt;/code&amp;gt; assigns the value &amp;lt;math display=&quot;inline&quot;&amp;gt;2&amp;lt;/math&amp;gt; to &amp;lt;math display=&quot;inline&quot;&amp;gt;z&amp;lt;/math&amp;gt; &amp;lt;code&amp;gt;t = b*[1;2;3];&amp;lt;/code&amp;gt; assigns the scalar product &amp;lt;math display=&quot;inline&quot;&amp;gt;-6 = 0+6-12&amp;lt;/math&amp;gt; to &amp;lt;math display=&quot;inline&quot;&amp;gt;t&amp;lt;/math&amp;gt; &amp;lt;code&amp;gt;F = C+D;&amp;lt;/code&amp;gt; assigns the matrix to &amp;lt;math display=&quot;inline&quot;&amp;gt;F&amp;lt;/math&amp;gt; &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;$ (&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;code&amp;gt;z = 10-8;&amp;lt;/code&amp;gt; assigns the value &amp;lt;math display=&quot;inline&quot;&amp;gt;2&amp;lt;/math&amp;gt; to &amp;lt;math display=&quot;inline&quot;&amp;gt;z&amp;lt;/math&amp;gt; &amp;lt;code&amp;gt;t = b*[1;2;3];&amp;lt;/code&amp;gt; assigns the scalar product &amp;lt;math display=&quot;inline&quot;&amp;gt;-6 = 0+6-12&amp;lt;/math&amp;gt; to &amp;lt;math display=&quot;inline&quot;&amp;gt;t&amp;lt;/math&amp;gt; &amp;lt;code&amp;gt;F = C+D;&amp;lt;/code&amp;gt; assigns the matrix to &amp;lt;math display=&quot;inline&quot;&amp;gt;F&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;\left(\begin{array}{ccc}2 &amp;amp; 3 \\ 3 &amp;amp; 2 \\ \end{array}\right)  = \left(\begin{array}{ccc} 1 &amp;amp; 1 \\0 &amp;amp; 1\\ \end{array}\right)&lt;/ins&gt;&amp;lt;/math&amp;gt;  &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;) = (&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;code&amp;gt;x = z^3;&amp;lt;/code&amp;gt; assigns the value &amp;lt;math display=&quot;inline&quot;&amp;gt;8 = 2^3&amp;lt;/math&amp;gt; to &amp;lt;math display=&quot;inline&quot;&amp;gt;x&amp;lt;/math&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;) (&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;); $ &lt;/del&gt;&amp;lt;code&amp;gt;x = z^3;&amp;lt;/code&amp;gt; assigns the value &amp;lt;math display=&quot;inline&quot;&amp;gt;8 = 2^3&amp;lt;/math&amp;gt; to &amp;lt;math display=&quot;inline&quot;&amp;gt;x&amp;lt;/math&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== The Colon-Operator ==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== The Colon-Operator ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l145&quot;&gt;Line 145:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 141:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;math display=&amp;quot;block&amp;quot;&amp;gt; A = \left(\begin{array}{ccc} 1 &amp;amp; -1 &amp;amp; 2\\ 3 &amp;amp; 0 &amp;amp; 1\\\end{array}\right) \, ,&amp;lt;/math&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;math display=&amp;quot;block&amp;quot;&amp;gt; A = \left(\begin{array}{ccc} 1 &amp;amp; -1 &amp;amp; 2\\ 3 &amp;amp; 0 &amp;amp; 1\\\end{array}\right) \, ,&amp;lt;/math&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l348&quot;&gt;Line 348:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 345:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;f_\sigma(x) = \frac{1}{\sqrt{2\pi}\sigma}e^{-\frac{x^2}{2\sigma^2}} .&amp;lt;/math&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;f_\sigma(x) = \frac{1}{\sqrt{2\pi}\sigma}e^{-\frac{x^2}{2\sigma^2}} .&amp;lt;/math&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key wiki:diff:1.41:old-647:rev-648:php=table --&gt;
&lt;/table&gt;</summary>
		<author><name>Davrot</name></author>
	</entry>
	<entry>
		<id>https://mscneuro.neuro.uni-bremen.de/index.php?title=Basic_Commands_and_Variables&amp;diff=647&amp;oldid=prev</id>
		<title>Davrot: /* Complex Numbers */</title>
		<link rel="alternate" type="text/html" href="https://mscneuro.neuro.uni-bremen.de/index.php?title=Basic_Commands_and_Variables&amp;diff=647&amp;oldid=prev"/>
		<updated>2025-10-23T13:45:25Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;Complex Numbers&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 13:45, 23 October 2025&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l145&quot;&gt;Line 145:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 145:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;math display=&amp;quot;block&amp;quot;&amp;gt; A = \left(\begin{array}{ccc} 1 &amp;amp; -1 &amp;amp; 2\\ 3 &amp;amp; 0 &amp;amp; 1\\\end{array}\right) \, ,&amp;lt;/math&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;math display=&amp;quot;block&amp;quot;&amp;gt; A = \left(\begin{array}{ccc} 1 &amp;amp; -1 &amp;amp; 2\\ 3 &amp;amp; 0 &amp;amp; 1\\\end{array}\right) \, ,&amp;lt;/math&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l233&quot;&gt;Line 233:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 234:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;phi = ange(c)&amp;lt;/syntaxhighlight&amp;gt;give the output 45.3100 and 1.1862. Conversely, a complex number can be defined by a length and an angle in the complex plane:&amp;lt;syntaxhighlight lang=&amp;quot;matlab&amp;quot;&amp;gt;c = amp*exp(i*phi);&amp;lt;/syntaxhighlight&amp;gt;The real and imaginary part of a complex number can then be extracted by the command real and imag:&amp;lt;syntaxhighlight lang=&amp;quot;matlab&amp;quot;&amp;gt;real(c), imag(c)&amp;lt;/syntaxhighlight&amp;gt;for example returns the output 17 and 42.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;phi = ange(c)&amp;lt;/syntaxhighlight&amp;gt;give the output 45.3100 and 1.1862. Conversely, a complex number can be defined by a length and an angle in the complex plane:&amp;lt;syntaxhighlight lang=&amp;quot;matlab&amp;quot;&amp;gt;c = amp*exp(i*phi);&amp;lt;/syntaxhighlight&amp;gt;The real and imaginary part of a complex number can then be extracted by the command real and imag:&amp;lt;syntaxhighlight lang=&amp;quot;matlab&amp;quot;&amp;gt;real(c), imag(c)&amp;lt;/syntaxhighlight&amp;gt;for example returns the output 17 and 42.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The command complex can also handle matrices and arrays as input. Thus&amp;lt;syntaxhighlight lang=&quot;matlab&quot;&amp;gt;c_array = complex(zeros(42, 1), rand(42, 1));&amp;lt;/syntaxhighlight&amp;gt;defines a &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;a &amp;lt;math display=&quot;inline&quot;&amp;gt;42&amp;lt;/math&amp;gt;x&lt;/del&gt;&amp;lt;math display=&quot;inline&quot;&amp;gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;1&lt;/del&gt;&amp;lt;/math&amp;gt;-matrix filled with complex numbers, that have a random imaginary part between &amp;lt;math display=&quot;inline&quot;&amp;gt;0&amp;lt;/math&amp;gt; and &amp;lt;math display=&quot;inline&quot;&amp;gt;1&amp;lt;/math&amp;gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The command complex can also handle matrices and arrays as input. Thus&amp;lt;syntaxhighlight lang=&quot;matlab&quot;&amp;gt;c_array = complex(zeros(42, 1), rand(42, 1));&amp;lt;/syntaxhighlight&amp;gt;defines a&amp;lt;math display=&quot;inline&quot;&amp;gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;42x1&lt;/ins&gt;&amp;lt;/math&amp;gt;-matrix filled with complex numbers, that have a random imaginary part between &amp;lt;math display=&quot;inline&quot;&amp;gt;0&amp;lt;/math&amp;gt; and &amp;lt;math display=&quot;inline&quot;&amp;gt;1&amp;lt;/math&amp;gt;.  &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Program Control Commands and Function Definition ==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Program Control Commands and Function Definition ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Programming in Matlab is carried out via script files and function files. The filenames end in “.m”, which is why these files are also named “M-files”. You should not use blank spaces, umlauts or mathematical operators (e.g. -) in the file names. One should also avoid naming the files after a build-in Matlab command, since this command will then be overwritten.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Programming in Matlab is carried out via script files and function files. The filenames end in “.m”, which is why these files are also named “M-files”. You should not use blank spaces, umlauts or mathematical operators (e.g. -) in the file names. One should also avoid naming the files after a build-in Matlab command, since this command will then be overwritten.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l348&quot;&gt;Line 348:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 348:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;f_\sigma(x) = \frac{1}{\sqrt{2\pi}\sigma}e^{-\frac{x^2}{2\sigma^2}} .&amp;lt;/math&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;f_\sigma(x) = \frac{1}{\sqrt{2\pi}\sigma}e^{-\frac{x^2}{2\sigma^2}} .&amp;lt;/math&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key wiki:diff:1.41:old-644:rev-647:php=table --&gt;
&lt;/table&gt;</summary>
		<author><name>Davrot</name></author>
	</entry>
	<entry>
		<id>https://mscneuro.neuro.uni-bremen.de/index.php?title=Basic_Commands_and_Variables&amp;diff=644&amp;oldid=prev</id>
		<title>Davrot: /* Variables */</title>
		<link rel="alternate" type="text/html" href="https://mscneuro.neuro.uni-bremen.de/index.php?title=Basic_Commands_and_Variables&amp;diff=644&amp;oldid=prev"/>
		<updated>2025-10-23T13:42:01Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;Variables&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 13:42, 23 October 2025&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l48&quot;&gt;Line 48:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 48:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;x+2y = 3&amp;lt;/math&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;x+2y = 3&amp;lt;/math&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;$&lt;/del&gt;3x+y = 1 &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;$&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;math&amp;gt;&lt;/ins&gt;3x+y = 1&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/math&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;can be formulated elegantly:&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;can be formulated elegantly:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l145&quot;&gt;Line 145:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 145:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;math display=&amp;quot;block&amp;quot;&amp;gt; A = \left(\begin{array}{ccc} 1 &amp;amp; -1 &amp;amp; 2\\ 3 &amp;amp; 0 &amp;amp; 1\\\end{array}\right) \, ,&amp;lt;/math&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;math display=&amp;quot;block&amp;quot;&amp;gt; A = \left(\begin{array}{ccc} 1 &amp;amp; -1 &amp;amp; 2\\ 3 &amp;amp; 0 &amp;amp; 1\\\end{array}\right) \, ,&amp;lt;/math&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l347&quot;&gt;Line 347:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 348:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;f_\sigma(x) = \frac{1}{\sqrt{2\pi}\sigma}e^{-\frac{x^2}{2\sigma^2}} .&amp;lt;/math&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;f_\sigma(x) = \frac{1}{\sqrt{2\pi}\sigma}e^{-\frac{x^2}{2\sigma^2}} .&amp;lt;/math&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Davrot</name></author>
	</entry>
	<entry>
		<id>https://mscneuro.neuro.uni-bremen.de/index.php?title=Basic_Commands_and_Variables&amp;diff=643&amp;oldid=prev</id>
		<title>Davrot: /* Basic Commands and Variables */</title>
		<link rel="alternate" type="text/html" href="https://mscneuro.neuro.uni-bremen.de/index.php?title=Basic_Commands_and_Variables&amp;diff=643&amp;oldid=prev"/>
		<updated>2025-10-23T13:40:59Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;Basic Commands and Variables&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 13:40, 23 October 2025&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;= Basic Commands and Variables =&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Questions to [mailto:davrot@uni-bremen.de David Rotermund]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;{:.no_toc}&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;nav class=&quot;toc-class&quot;&amp;gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;* TOC {:toc}&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/nav&amp;gt; &lt;/del&gt;Questions to [mailto:davrot@uni-bremen.de David Rotermund]&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#039;&amp;#039;By Jan Wiersig, modified by Udo Ernst and translated into English by Daniel Harnack.&amp;#039;&amp;#039;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#039;&amp;#039;By Jan Wiersig, modified by Udo Ernst and translated into English by Daniel Harnack.&amp;#039;&amp;#039;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l71&quot;&gt;Line 71:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 64:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;math display=&amp;quot;block&amp;quot;&amp;gt;\nearrow \nwarrow&amp;lt;/math&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;math display=&amp;quot;block&amp;quot;&amp;gt;\nearrow \nwarrow&amp;lt;/math&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# line 2. line&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;#line 2. line&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;and the column vectors&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;and the column vectors&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l152&quot;&gt;Line 152:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 145:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;math display=&amp;quot;block&amp;quot;&amp;gt; A = \left(\begin{array}{ccc} 1 &amp;amp; -1 &amp;amp; 2\\ 3 &amp;amp; 0 &amp;amp; 1\\\end{array}\right) \, ,&amp;lt;/math&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;math display=&amp;quot;block&amp;quot;&amp;gt; A = \left(\begin{array}{ccc} 1 &amp;amp; -1 &amp;amp; 2\\ 3 &amp;amp; 0 &amp;amp; 1\\\end{array}\right) \, ,&amp;lt;/math&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;from which we want to determine the first and the third column.&amp;lt;syntaxhighlight lang=&amp;quot;matlab&amp;quot;&amp;gt;A = [1,-1,2;3,0,1];&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;from which we want to determine the first and the third column.&amp;lt;syntaxhighlight lang=&amp;quot;matlab&amp;quot;&amp;gt;A = [1,-1,2;3,0,1];&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l352&quot;&gt;Line 352:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 347:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;f_\sigma(x) = \frac{1}{\sqrt{2\pi}\sigma}e^{-\frac{x^2}{2\sigma^2}} .&amp;lt;/math&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;f_\sigma(x) = \frac{1}{\sqrt{2\pi}\sigma}e^{-\frac{x^2}{2\sigma^2}} .&amp;lt;/math&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;For this end we write the following file ‘gauss.m’:&amp;lt;syntaxhighlight lang=&amp;quot;matlab&amp;quot;&amp;gt;function y = gauss(x,sigma)&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;For this end we write the following file ‘gauss.m’:&amp;lt;syntaxhighlight lang=&amp;quot;matlab&amp;quot;&amp;gt;function y = gauss(x,sigma)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key wiki:diff:1.41:old-642:rev-643:php=table --&gt;
&lt;/table&gt;</summary>
		<author><name>Davrot</name></author>
	</entry>
	<entry>
		<id>https://mscneuro.neuro.uni-bremen.de/index.php?title=Basic_Commands_and_Variables&amp;diff=642&amp;oldid=prev</id>
		<title>Davrot: Created page with &quot; = Basic Commands and Variables = {:.no_toc}  &lt;nav class=&quot;toc-class&quot;&gt;  * TOC {:toc}  &lt;/nav&gt; Questions to [mailto:davrot@uni-bremen.de David Rotermund]  &#039;&#039;By Jan Wiersig, modified by Udo Ernst and translated into English by Daniel Harnack.&#039;&#039;  Matlab is an interactive system used for numerical calculations and visualization in almost every field of technical and scientific research. Matlab excels in its ease of use, good graphics and high efficiency.  This introduction exp...&quot;</title>
		<link rel="alternate" type="text/html" href="https://mscneuro.neuro.uni-bremen.de/index.php?title=Basic_Commands_and_Variables&amp;diff=642&amp;oldid=prev"/>
		<updated>2025-10-23T13:40:46Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot; = Basic Commands and Variables = {:.no_toc}  &amp;lt;nav class=&amp;quot;toc-class&amp;quot;&amp;gt;  * TOC {:toc}  &amp;lt;/nav&amp;gt; Questions to [mailto:davrot@uni-bremen.de David Rotermund]  &amp;#039;&amp;#039;By Jan Wiersig, modified by Udo Ernst and translated into English by Daniel Harnack.&amp;#039;&amp;#039;  Matlab is an interactive system used for numerical calculations and visualization in almost every field of technical and scientific research. Matlab excels in its ease of use, good graphics and high efficiency.  This introduction exp...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&lt;br /&gt;
= Basic Commands and Variables =&lt;br /&gt;
{:.no_toc}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nav class=&amp;quot;toc-class&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* TOC {:toc}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nav&amp;gt; Questions to [mailto:davrot@uni-bremen.de David Rotermund]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;By Jan Wiersig, modified by Udo Ernst and translated into English by Daniel Harnack.&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Matlab is an interactive system used for numerical calculations and visualization in almost every field of technical and scientific research. Matlab excels in its ease of use, good graphics and high efficiency.&lt;br /&gt;
&lt;br /&gt;
This introduction explains the basics mandatory to perform simple numerical calculations. First, we use Matlab as a command line interpreter. Entering of single commands will follow a prompt, here &amp;lt;code&amp;gt;&amp;amp;#x3E;&amp;amp;#x3E;&amp;lt;/code&amp;gt;. An important command is &amp;lt;code&amp;gt;help&amp;lt;/code&amp;gt;. This command returns descriptions and syntax for functions and commands. For example&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;help sin&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
shows information regarding the sine function. Also a link to the detailed documentations can be found, that can directly be called alternatively with the command &amp;lt;code&amp;gt;doc&amp;lt;/code&amp;gt;. Short descriptions of commands, that match certain search pattern, can be obtained by &amp;lt;code&amp;gt;lookfor&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Further useful commands include &amp;lt;code&amp;gt;quit&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;exit&amp;lt;/code&amp;gt;, with which the Matlab session is terminated.&lt;br /&gt;
&lt;br /&gt;
== Variables ==&lt;br /&gt;
Variables are introduced by assignment and do not have to be declared or defined. Names of the variables can be chosen freely. The only forbidden things are the use of special characters and digits at the beginning of the name. A distinction between uppercase and lowercase letters is not made. Examples:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&amp;lt;code&amp;gt;a = 3;&amp;lt;/code&amp;gt;&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; |3 is assigned to a (no output)&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;a&amp;lt;/code&amp;gt;&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; |result output&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;b = -2.5&amp;lt;/code&amp;gt;&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | -2,5 is assigned to b (with output)&lt;br /&gt;
|}&lt;br /&gt;
Note that Matlab uses a point to separate pre-decimal places and post-decimal places, following the conventions of the English language.&lt;br /&gt;
&lt;br /&gt;
A major advantage of Matlab in comparison to a conventional programming language is the possibility to directly work with vectors. This concept shall only be touched briefly here, since it will be extensively treated in a separate chapter:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&amp;lt;code&amp;gt;a = [3;1];&amp;lt;/code&amp;gt;&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; |defines a column vector&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; |&amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;\vec{a} = \left(\begin{pmatrix}3 \\ 1 \end{pmatrix}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;a(k)&amp;lt;/code&amp;gt;&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; |means the vector component&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; |&amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;a_k&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;b = [0,3,-4];&amp;lt;/code&amp;gt;&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; |defines a row vector&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; |&amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;\vec{b} = (0,3,-4)&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
The commas in square brackets can also be replaced by blank spaces.&lt;br /&gt;
&lt;br /&gt;
Matlab cannot only calculate with vectors, but also with matrices. Thus, linear system of equations, such as&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;x+2y = 3&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
$3x+y = 1 $&lt;br /&gt;
&lt;br /&gt;
can be formulated elegantly:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math display=&amp;quot;block&amp;quot;&amp;gt; \left(\begin{array}{cc} 1 &amp;amp; 2 \\ 3 &amp;amp; 1 \end{array}\right) \left(\begin{array}{c} x &amp;amp; y \end{array}\right) = \left(\begin{matrix} 3 &amp;amp; 1 \end{matrix}\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
respectively&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math display=&amp;quot;block&amp;quot;&amp;gt;D\,\vec{x} = \vec{b} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with the &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;2\times 2&amp;lt;/math&amp;gt; matrix&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math display=&amp;quot;block&amp;quot;&amp;gt; D = \left(\begin{array}{cc}1 &amp;amp; 2 \\ 3 &amp;amp; 1 \end{array}\right) \begin{array}{c}\leftarrow\;\;\mbox{1. line} \\ \leftarrow\;\;\mbox{2. line} \\ \end{array}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math display=&amp;quot;block&amp;quot;&amp;gt;\nearrow \nwarrow&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# line 2. line&lt;br /&gt;
&lt;br /&gt;
and the column vectors&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math display=&amp;quot;block&amp;quot;&amp;gt; \vec{x} = \left(\begin{array}{c}x &amp;amp; y \end{array}\right) \quad\mbox{and}\quad \vec{b} = \left(\begin{array}{c}3 &amp;amp; 1 \end{array}\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here, &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;\vec{x}&amp;lt;/math&amp;gt; is the solution vector being sought.&lt;br /&gt;
&lt;br /&gt;
The formal solution of the equation &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;D\,\vec{x} = \vec{b}&amp;lt;/math&amp;gt; is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math display=&amp;quot;block&amp;quot;&amp;gt;\vec{x} = D^{-1}\, \vec{b} \, ,&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;D^{-1}&amp;lt;/math&amp;gt; denotes the inverse of the matrix &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;D&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Matrices are introduced in Matlab as the following&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;C = [1,1;0,1];&amp;lt;/code&amp;gt; defines the &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;2\times 2&amp;lt;/math&amp;gt; matrix &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;C = \left(\begin{array}{ccc}1 &amp;amp; 1\\0 &amp;amp; 1\\\end{array}\right)&amp;lt;/math&amp;gt; &amp;lt;code&amp;gt;D = [1,2;3,1];&amp;lt;/code&amp;gt; defines the &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;2\times 2&amp;lt;/math&amp;gt; matrix &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;D = \left(\begin{array}{ccc}1 &amp;amp; 2\\3 &amp;amp; 1\\\end{array}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The single elements &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;C_{kl}&amp;lt;/math&amp;gt; of a matrix &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;C&amp;lt;/math&amp;gt; can be accessed by C(k,l). Here, &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;k&amp;lt;/math&amp;gt; denotes the &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;k&amp;lt;/math&amp;gt;-th row and &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;l&amp;lt;/math&amp;gt; the &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;l&amp;lt;/math&amp;gt;-th column of the matrix.&lt;br /&gt;
&lt;br /&gt;
Interestingly, all variables that are used by Matlab are matrices, which is how the name is derived (“Matrix Laboratory”).&lt;br /&gt;
&lt;br /&gt;
The following table lists useful commands to manage variables.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&amp;lt;code&amp;gt;who&amp;lt;/code&amp;gt;&lt;br /&gt;
|List of all used variables&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;whos&amp;lt;/code&amp;gt;&lt;br /&gt;
|List of all used variables with respective size&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;clear&amp;lt;/code&amp;gt;&lt;br /&gt;
|Variable Delete a variable&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;clear all&amp;lt;/code&amp;gt;&lt;br /&gt;
|Delete all variables&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;load &amp;#039;filename&amp;#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
|Load variable(s) from a file&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;save &amp;#039;filename&amp;#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
|variable Save variable to a file&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;!&amp;lt;/code&amp;gt;&lt;br /&gt;
|execute a Linux/MSDOS-command&lt;br /&gt;
|}&lt;br /&gt;
Some specific variables are predefined:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&amp;lt;code&amp;gt;ans&amp;lt;/code&amp;gt;&lt;br /&gt;
|Last result&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;pi&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;\pi&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;i&amp;lt;/code&amp;gt;&lt;br /&gt;
|Imaginary unit &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;\sqrt{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;Inf&amp;lt;/code&amp;gt;&lt;br /&gt;
|Infinity (z.B. &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;1/0&amp;lt;/math&amp;gt;)&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;NaN&amp;lt;/code&amp;gt;&lt;br /&gt;
|“Not-a-Number” (e.g. &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;0/0&amp;lt;/math&amp;gt;)&lt;br /&gt;
|}&lt;br /&gt;
Note that the predefined variable can also be overwritten. Sometimes this happens unintendedly and leads to unpredictable results.&lt;br /&gt;
&lt;br /&gt;
== Operations ==&lt;br /&gt;
The basic arithmetic operations like addition (+), subtraction (-), multiplication (*), division (/) and powers (^) are defined in a natural manner. Examples using the earlier defined variables are&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;z = 10-8;&amp;lt;/code&amp;gt; assigns the value &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;2&amp;lt;/math&amp;gt; to &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;z&amp;lt;/math&amp;gt; &amp;lt;code&amp;gt;t = b*[1;2;3];&amp;lt;/code&amp;gt; assigns the scalar product &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;-6 = 0+6-12&amp;lt;/math&amp;gt; to &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;t&amp;lt;/math&amp;gt; &amp;lt;code&amp;gt;F = C+D;&amp;lt;/code&amp;gt; assigns the matrix to &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;F&amp;lt;/math&amp;gt; $ (&lt;br /&gt;
&lt;br /&gt;
) = (&lt;br /&gt;
&lt;br /&gt;
) (&lt;br /&gt;
&lt;br /&gt;
); $ &amp;lt;code&amp;gt;x = z^3;&amp;lt;/code&amp;gt; assigns the value &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;8 = 2^3&amp;lt;/math&amp;gt; to &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;x&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== The Colon-Operator ==&lt;br /&gt;
The colon is used in Matlab to generate sequences of numbers, e.g&amp;lt;syntaxhighlight lang=&amp;quot;matlab&amp;quot;&amp;gt;x=1:10;&amp;lt;/syntaxhighlight&amp;gt;generates a row vector &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;\vec{x} = (1,2,\ldots,10)&amp;lt;/math&amp;gt;, which holds the numbers from 1 to 10 in increments of 1. The increment can be set between the start and the end value:&amp;lt;syntaxhighlight lang=&amp;quot;matlab&amp;quot;&amp;gt;x=0:0.1:1;&amp;lt;/syntaxhighlight&amp;gt;The result is a row vector &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;\vec{x} = (0,0.1,\ldots,1)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The colon-operator is especially handy to access defined elements of vectors, e.g.&amp;lt;syntaxhighlight lang=&amp;quot;matlab&amp;quot;&amp;gt;x(3:6)&amp;lt;/syntaxhighlight&amp;gt;gives the elements &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;(0.2,0.3,0.4,0.5)&amp;lt;/math&amp;gt;. When the colon-operator stands on its own, e.g. &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;\texttt{x(:)}&amp;lt;/math&amp;gt;, all elements of the vector are referenced. This becomes especially interesting in the case of matrices. As a case in point we consider the matrix&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math display=&amp;quot;block&amp;quot;&amp;gt; A = \left(\begin{array}{ccc} 1 &amp;amp; -1 &amp;amp; 2\\ 3 &amp;amp; 0 &amp;amp; 1\\\end{array}\right) \, ,&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
from which we want to determine the first and the third column.&amp;lt;syntaxhighlight lang=&amp;quot;matlab&amp;quot;&amp;gt;A = [1,-1,2;3,0,1];&lt;br /&gt;
a = A(:,1);&lt;br /&gt;
b = A(:,3);&amp;lt;/syntaxhighlight&amp;gt;The result is &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;\vec{a} = \left(\begin{array}{c}1\\ 3\\\end{array}\right)&amp;lt;/math&amp;gt; and &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;\vec{b} = \left(\begin{array}{c}2\\ 1\\\end{array}\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Mathematical Functions ==&lt;br /&gt;
Matlab provides a wealth of mathematical and numerical functions. All functions are applied to the whole vector respectively matrix. The following tables summarize the basic functions.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&amp;lt;code&amp;gt;abs(x)&amp;lt;/code&amp;gt;&lt;br /&gt;
|absolute value&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;sqrt(x)&amp;lt;/code&amp;gt;&lt;br /&gt;
|square root&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;sin(x)&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;cos(x)&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tan(x)&amp;lt;/code&amp;gt;&lt;br /&gt;
|sine, cosine, tangent&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;atan2(y,x)&amp;lt;/code&amp;gt;&lt;br /&gt;
|arc tangent of &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;y/x&amp;lt;/math&amp;gt; in the interval &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;[0,2\pi)&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;exp(x)&amp;lt;/code&amp;gt;&lt;br /&gt;
|exponential function&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;log(x)&amp;lt;/code&amp;gt;&lt;br /&gt;
|, log10(x) natural logarithm, logarithm to the basis 10&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;besselj(n,x)&amp;lt;/code&amp;gt;&lt;br /&gt;
|Bessel function &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;n&amp;lt;/math&amp;gt;-th order&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;rem(x,y)&amp;lt;/code&amp;gt;&lt;br /&gt;
|rest after division (z.B. rem(10.3,4) = 2.3)&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;round(x)&amp;lt;/code&amp;gt;&lt;br /&gt;
|rounding (z.B. round(3.2) = 3)&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;floor(x)&amp;lt;/code&amp;gt;&lt;br /&gt;
|round down (z.B. floor(3.2) = 3)&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;ceil(x)&amp;lt;/code&amp;gt;&lt;br /&gt;
|round up (z.B. ceil(3.2) = 4)&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;norm(x)&amp;lt;/code&amp;gt;&lt;br /&gt;
|norm (length) of a vector&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;sum(x)&amp;lt;/code&amp;gt;&lt;br /&gt;
|sum over vector elements&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;prod(x)&amp;lt;/code&amp;gt;&lt;br /&gt;
|product over vector elements&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;max(x)&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;min(x)&amp;lt;/code&amp;gt;&lt;br /&gt;
|maximum, minimum of vector elements&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;length(x)&amp;lt;/code&amp;gt;&lt;br /&gt;
|dimension of a vector&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;mean(x)&amp;lt;/code&amp;gt;&lt;br /&gt;
|mean&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;std(x)&amp;lt;/code&amp;gt;&lt;br /&gt;
|standard deviation&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;size(A)&amp;lt;/code&amp;gt;&lt;br /&gt;
|dimension of the matrix &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;A&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;det(A)&amp;lt;/code&amp;gt;&lt;br /&gt;
|determinant of the matrix &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;A&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;rank(A)&amp;lt;/code&amp;gt;&lt;br /&gt;
|rank of the matrix &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;A&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;rand(N)&amp;lt;/code&amp;gt;&lt;br /&gt;
|uniformly distributed random numbers between &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;[0,1)&amp;lt;/math&amp;gt;. &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;N\times N&amp;lt;/math&amp;gt; matrix&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;randn(N)&amp;lt;/code&amp;gt;&lt;br /&gt;
|Gaussian distributed random numbers with mean = 0 and variance = 1.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Complex Numbers ==&lt;br /&gt;
An important feature of Matlab is that it provides a variable type for complex numbers. As long as it is not already used in another context, like a loop, the variable i is predefined as the complex unit. In general, complex numbers can be defined by invoking the command complex with two arguments, that represent the real- respectively the imaginary part of the number, e.g.:&amp;lt;syntaxhighlight lang=&amp;quot;matlab&amp;quot;&amp;gt;i = complex(0, 1);&amp;lt;/syntaxhighlight&amp;gt;Computations with complex numbers can be carried out just like with normal, real values. Hence, the following to lines&amp;lt;syntaxhighlight lang=&amp;quot;matlab&amp;quot;&amp;gt;c = complex(17, 42);&lt;br /&gt;
c = 17+i*42;&amp;lt;/syntaxhighlight&amp;gt;give the same results.&lt;br /&gt;
&lt;br /&gt;
In the imaginary plane, the complex number can be represented as a vector with a length amp, that starts in the origin and points in the direction phi. These quantities can be derived from the complex numbers through the commands abs and angle. The commands&amp;lt;syntaxhighlight lang=&amp;quot;matlab&amp;quot;&amp;gt;amp = abs(c)&lt;br /&gt;
phi = ange(c)&amp;lt;/syntaxhighlight&amp;gt;give the output 45.3100 and 1.1862. Conversely, a complex number can be defined by a length and an angle in the complex plane:&amp;lt;syntaxhighlight lang=&amp;quot;matlab&amp;quot;&amp;gt;c = amp*exp(i*phi);&amp;lt;/syntaxhighlight&amp;gt;The real and imaginary part of a complex number can then be extracted by the command real and imag:&amp;lt;syntaxhighlight lang=&amp;quot;matlab&amp;quot;&amp;gt;real(c), imag(c)&amp;lt;/syntaxhighlight&amp;gt;for example returns the output 17 and 42.&lt;br /&gt;
&lt;br /&gt;
The command complex can also handle matrices and arrays as input. Thus&amp;lt;syntaxhighlight lang=&amp;quot;matlab&amp;quot;&amp;gt;c_array = complex(zeros(42, 1), rand(42, 1));&amp;lt;/syntaxhighlight&amp;gt;defines a a &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;42&amp;lt;/math&amp;gt;x&amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;1&amp;lt;/math&amp;gt;-matrix filled with complex numbers, that have a random imaginary part between &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;0&amp;lt;/math&amp;gt; and &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;1&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Program Control Commands and Function Definition ==&lt;br /&gt;
Programming in Matlab is carried out via script files and function files. The filenames end in “.m”, which is why these files are also named “M-files”. You should not use blank spaces, umlauts or mathematical operators (e.g. -) in the file names. One should also avoid naming the files after a build-in Matlab command, since this command will then be overwritten.&lt;br /&gt;
&lt;br /&gt;
Simply put, script and function files contain a list of commands. These commands will then simply be executed in succession. More complex program structures are realized with loops and bifurcations. Essentially, there are the following possibilities to control the flow of a program – These constructs are found in every programming language, not only in Matlab.&lt;br /&gt;
&lt;br /&gt;
[[File:2022-04-15_17-17.png|Figure 3.1.]] Figure 3.1.: Diﬀerent possibilities to control the ﬂow of a program, respectively the succession of commands contained in a program.&lt;br /&gt;
&lt;br /&gt;
=== Loops (‘for’-Loops) ===&lt;br /&gt;
Reoccurring operations are executed within loops. If it is desired to execute a specific set of commands &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;n&amp;lt;/math&amp;gt;-times in a row, the use of a so called for-loop is advisable. As an example, we want to create a vector &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;\vec{p} = (p_1,p_2,p_3,p_4,p_5)&amp;lt;/math&amp;gt; with &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;p_k = k^2&amp;lt;/math&amp;gt;, where &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;k=1,2,3,4,5&amp;lt;/math&amp;gt;. The symbol &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;\texttt{\%}&amp;lt;/math&amp;gt; induces commentaries:&amp;lt;syntaxhighlight lang=&amp;quot;matlab&amp;quot;&amp;gt;for k=1:5 % begin of the loop&lt;br /&gt;
    p(k) = k^2; % entries in the row vector&lt;br /&gt;
end % end of the loop&amp;lt;/syntaxhighlight&amp;gt;The result is a row vector &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;\vec{p} = (1,4,9,16,25)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Note that frequently, loops in Matlab can be replaced by the use of the colon-operator, here p = [1:5].^ 2. The latter is definitely preferable, since the execution is faster. In analogy to the colon-operator, an increment different form 1 can be set, e.g.&amp;lt;syntaxhighlight lang=&amp;quot;matlab&amp;quot;&amp;gt;for k=1:2:5&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Conditional Loops (‘while’-Loops) ===&lt;br /&gt;
The difference between the the while-loop and the for-loop, where the number of times which the body of the loop is executed has to be known beforehand, is that the execution of the commands in the while-loop is tied to a condition: prior to every iteration this condition is tested. If the test turn out positive, the loop will be run through. Otherwise the loop will be left (or not even entered in the first place), and the commands following the loop will be executed. Example:&amp;lt;syntaxhighlight lang=&amp;quot;matlab&amp;quot;&amp;gt;x=5;&lt;br /&gt;
&lt;br /&gt;
while(x&amp;gt;1) % begin of the loop (infinite loop possible)&lt;br /&gt;
    x=x/2;&lt;br /&gt;
end % end of the loop&amp;lt;/syntaxhighlight&amp;gt;The result is &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;x = 5/8 = 0.625&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Bifurcations/Conditional Execution (‘if’-Expressions) ===&lt;br /&gt;
Conditional execution of commands is also mediated by if-expressions. The result of the bifurcation depends on the result of the result of the if-statement.&lt;br /&gt;
&lt;br /&gt;
Example:&amp;lt;syntaxhighlight lang=&amp;quot;matlab&amp;quot;&amp;gt;if (x&amp;gt;5)&lt;br /&gt;
    z = 1;&lt;br /&gt;
end&amp;lt;/syntaxhighlight&amp;gt;Provided the relation &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;x &amp;gt; 5&amp;lt;/math&amp;gt; is fulfilled, set &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;z = 1&amp;lt;/math&amp;gt;. The following operators are available to construct relations:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&amp;amp;#x3E;&lt;br /&gt;
|greater&lt;br /&gt;
|-&lt;br /&gt;
|&amp;amp;#x3C;&lt;br /&gt;
|smaller&lt;br /&gt;
|-&lt;br /&gt;
|&amp;amp;#x3E;=&lt;br /&gt;
|greater or equal&lt;br /&gt;
|-&lt;br /&gt;
|&amp;amp;#x3C;=&lt;br /&gt;
|smaller or equal&lt;br /&gt;
|-&lt;br /&gt;
|==&lt;br /&gt;
|equal&lt;br /&gt;
|-&lt;br /&gt;
|~=&lt;br /&gt;
|unequal&lt;br /&gt;
|-&lt;br /&gt;
|&amp;amp;#x26;&lt;br /&gt;
|logical ‘and’&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|logical ‘or’&lt;br /&gt;
|-&lt;br /&gt;
|~&lt;br /&gt;
|logical ‘not’&lt;br /&gt;
|}&lt;br /&gt;
The command if comes with the command else. Example:&amp;lt;syntaxhighlight lang=&amp;quot;matlab&amp;quot;&amp;gt;if (0 &amp;lt; x &amp;amp; x &amp;lt; 1)&lt;br /&gt;
    status = 1;&lt;br /&gt;
else&lt;br /&gt;
    status = 0;&lt;br /&gt;
end&amp;lt;/syntaxhighlight&amp;gt;If &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;0 &amp;lt; x&amp;lt;/math&amp;gt; and &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;x &amp;lt; 1&amp;lt;/math&amp;gt;, then set status = 1, else set status = 0. The command else thus allows to react to a unfulfilled condition. If this shall be coupled to a further condition, the command elseif (has to be written as one word) can be used.&lt;br /&gt;
&lt;br /&gt;
== Data Input and Output ==&lt;br /&gt;
&lt;br /&gt;
=== Keyboard and Screen ===&lt;br /&gt;
For input from the keyboard, the command input is provided:&amp;lt;syntaxhighlight lang=&amp;quot;matlab&amp;quot;&amp;gt;x = input(&amp;#039;Input x: &amp;#039;);&amp;lt;/syntaxhighlight&amp;gt;The command disp displays text and values of variables on the screen:&amp;lt;syntaxhighlight lang=&amp;quot;matlab&amp;quot;&amp;gt;disp(&amp;#039;The value of x is &amp;#039;);&lt;br /&gt;
disp(x);&amp;lt;/syntaxhighlight&amp;gt;Formatted output is achieved by the command fprintf, e.g.&amp;lt;syntaxhighlight lang=&amp;quot;matlab&amp;quot;&amp;gt;fprintf(&amp;#039;The value of x is %g \n&amp;#039;,x);&amp;lt;/syntaxhighlight&amp;gt;In this connection, %g is a placeholder for the variable x. The symbol forces the following output to begin in a new line. Another Example is&amp;lt;syntaxhighlight lang=&amp;quot;matlab&amp;quot;&amp;gt;fprintf(&amp;#039;x = %6.2f \n&amp;#039;,x);&amp;lt;/syntaxhighlight&amp;gt;Here, the first number after the percent symbol sets the minimal total number of digits or characters that shall be printed. The second number is the desired number of post-decimal places.&lt;br /&gt;
&lt;br /&gt;
=== Storage Media ===&lt;br /&gt;
The output to the hard disk or other storage media takes place in a similar way.&lt;br /&gt;
&lt;br /&gt;
Prior to writing to or reading from a file, this file has to be opened. This is done with the command fopen.&lt;br /&gt;
&lt;br /&gt;
Example:&amp;lt;syntaxhighlight lang=&amp;quot;matlab&amp;quot;&amp;gt;fp = fopen(&amp;#039;example.dat&amp;#039;, &amp;#039;w&amp;#039;);&amp;lt;/syntaxhighlight&amp;gt;example.dat is the name of the data being opened and ‘w’ indicates that we want to write something into the data (=write). Upon successful execution of the command, Matlab returns a so called file handle. This can be understood as a pointer when writing into the file, which tells the computer where the data is supposed to go.&lt;br /&gt;
&lt;br /&gt;
Similar to printing to the screen, data can now be written into the file:&amp;lt;syntaxhighlight lang=&amp;quot;matlab&amp;quot;&amp;gt;fprintf(fp, &amp;#039;x = %6.2f \n&amp;#039;,x);&amp;lt;/syntaxhighlight&amp;gt;Note that the ‘file handle’ fp is passed as the first argument to the fprintf-command.&lt;br /&gt;
&lt;br /&gt;
After writing of the data, the file is closed by the command fclose. In the same manner, the file handle has to be passed to the command:&amp;lt;syntaxhighlight lang=&amp;quot;matlab&amp;quot;&amp;gt;fclose(fp);&amp;lt;/syntaxhighlight&amp;gt;The read-in of formatted text works along the same lines; However, when using fopen, the option ‘r’ for reading of data (=read) has to be set, and for read-in, the command fscanf has to be utilized with a suitable format.&lt;br /&gt;
&lt;br /&gt;
Data can also be written and read in a binary format. Here, the data of the computer is written into a file in its internal binary representation. An advantage of this type of data storage is its usually low memory demand. A drawback is that the files produced in this manner can not be opened and the contents inspected by a conventional text editor. In addition, it can occur that the data transfer between two computers with different machine architecture is hampered, in case they utilize different representations of floating-point numbers and integers.&lt;br /&gt;
&lt;br /&gt;
The respective commands to read and write binary data are fread and fwrite. The files are opened and closed as usual via fopen and fclose.&lt;br /&gt;
&lt;br /&gt;
Additionally, Matlab provides a third possibility to store data: the commands save and load. The syntax of these commands is&amp;lt;syntaxhighlight lang=&amp;quot;matlab&amp;quot;&amp;gt;load(&amp;#039;filename.mat&amp;#039;, &amp;#039;var1&amp;#039;, &amp;#039;var2&amp;#039;, ..., &amp;#039;varN&amp;#039;);&amp;lt;/syntaxhighlight&amp;gt;and&amp;lt;syntaxhighlight lang=&amp;quot;matlab&amp;quot;&amp;gt;save(&amp;#039;filename.mat&amp;#039;, &amp;#039;var1&amp;#039;, &amp;#039;var2&amp;#039;, ..., &amp;#039;varN&amp;#039;);&amp;lt;/syntaxhighlight&amp;gt;The variables with the names var1, var2 until varN are saved respectively loaded. The suffix of a Matlab-file should always be .mat. Loss-free compression and system-wide compatibility are the advantages of this method. Unfortunately, files created by different Matlab versions are sometimes incompatible.&lt;br /&gt;
&lt;br /&gt;
Note: if no variable names are specified, all variables that momentarily reside in the working memory will be saved.&lt;br /&gt;
&lt;br /&gt;
=== Example of a Simple Program: Orthogonality of Two Vectors ===&lt;br /&gt;
The following script file probes the orthogonality of two vectors &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;\vec{a}&amp;lt;/math&amp;gt; and &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;\vec{b}&amp;lt;/math&amp;gt;, i.e. it is tested whether the scalar product of the two vectors is zero. Please try to understand the program with the help of the given commentaries.&amp;lt;syntaxhighlight lang=&amp;quot;matlab&amp;quot;&amp;gt;% orthog - program to test the orthogonality of two vectors (3D)&lt;br /&gt;
&lt;br /&gt;
clear all;  % delete all variables&lt;br /&gt;
&lt;br /&gt;
% initalize the vectors a and b&lt;br /&gt;
a = input(&amp;#039;give 1. vector: &amp;#039;);&lt;br /&gt;
b = input(&amp;#039;give 2. vector: &amp;#039;);&lt;br /&gt;
&lt;br /&gt;
% evaluate the scalar product&lt;br /&gt;
ab = 0;&lt;br /&gt;
for i=1:3&lt;br /&gt;
    ab = ab+a(i)*b(i);&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
% tell whether the vectors are orthogonal&lt;br /&gt;
if (abs(ab) &amp;lt; 1.0e-8)&lt;br /&gt;
    disp(&amp;#039;vectors are orthogonal&amp;#039;);&lt;br /&gt;
else&lt;br /&gt;
    disp(&amp;#039;vectors are not orthogonal&amp;#039;);&lt;br /&gt;
    fprintf(&amp;#039;scalar product = %g \n&amp;#039;, ab);&lt;br /&gt;
end&amp;lt;/syntaxhighlight&amp;gt;Matlab provides an own editor, that facilitates the writing of programs. In our case, the script file would be named’orthog.m’. Given that the file is in the correct folder, the program can be invoked with the command orthog.&lt;br /&gt;
&lt;br /&gt;
== Self-defined Functions and Sub-programs ==&lt;br /&gt;
New, own functions can be defined as a function file. In the same way it is possible to superimpose existing implementations of Matlab-functions with own functions. Assuming that we want to implement the Gaussian bell-curve&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;f_\sigma(x) = \frac{1}{\sqrt{2\pi}\sigma}e^{-\frac{x^2}{2\sigma^2}} .&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For this end we write the following file ‘gauss.m’:&amp;lt;syntaxhighlight lang=&amp;quot;matlab&amp;quot;&amp;gt;function y = gauss(x,sigma)&lt;br /&gt;
&lt;br /&gt;
% function to calculate the Gaussian bell-curve&lt;br /&gt;
&lt;br /&gt;
y = exp(-x.^2/(2*sigma^2))/(sqrt(2*pi)*sigma);&lt;br /&gt;
&lt;br /&gt;
return;&amp;lt;/syntaxhighlight&amp;gt;The parameter &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;y&amp;lt;/math&amp;gt; is an output parameter, while &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;x&amp;lt;/math&amp;gt; and &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;\sigma&amp;lt;/math&amp;gt; are input parameters. Note that the respective file name only differs from the name of the function the file defines by the suffix ‘.m’. The function gauss is thus to be defined in ‘gauss.m’, nowhere else.&lt;br /&gt;
&lt;br /&gt;
The self-defined function gauss will hence be used just like a built-in Matlab-function. For example with&amp;lt;syntaxhighlight lang=&amp;quot;matlab&amp;quot;&amp;gt;x = -4:0.01:4;&lt;br /&gt;
&lt;br /&gt;
plot(x,gauss(x,1));&amp;lt;/syntaxhighlight&amp;gt;the function can be plotted. Even the help functions help gauss and lookfor gauss work. Printed on the screen are in this case the comment lines preceding the first command in the file ‘gauss.m’.&lt;br /&gt;
&lt;br /&gt;
Naturally, new functions can also be provided with several output parameters. For this a vector-valued output parameter is used, which components hold the actual output parameters.&lt;br /&gt;
&lt;br /&gt;
Self-defined functions can also be called within any script or function file. This can be used to structure programs into a main program and sub-program to increase the clarity and the readability of the code ( see e.g. fig.3.2. Conveniently, variables defined within a function are always local, i.e. unknown to other program parts. Hereby, unwanted ‘side effects’ are avoided.&lt;br /&gt;
&lt;br /&gt;
[[File:2022-04-15_17-19.png|Figure 3.2.]] Figure 3.2.: Schematic example of the subdivision of a program (Calculation and illustration of two oscillation modes of a physical system) into a main program and various sub-programs.&lt;br /&gt;
&lt;br /&gt;
=== Functions as Input Arguments ===&lt;br /&gt;
In many applications, one may want to not only give parameters to sub-programs, but also functions. The evaluation of the function passed to the sub-program is done with the command feval. Consider an example of a sub-program which plots a given function in a predefined interval including annotation of the axes, etc:&amp;lt;syntaxhighlight lang=&amp;quot;matlab&amp;quot;&amp;gt;function plotfunction(f,a,b) % no output parameter&lt;br /&gt;
&lt;br /&gt;
x = a:0.01:b;&lt;br /&gt;
&lt;br /&gt;
y = feval(f,x);&lt;br /&gt;
&lt;br /&gt;
plot(x,y);&lt;br /&gt;
&lt;br /&gt;
xlabel(&amp;#039;x&amp;#039;);&lt;br /&gt;
&lt;br /&gt;
ylabel(&amp;#039;y&amp;#039;);&lt;br /&gt;
&lt;br /&gt;
return;&amp;lt;/syntaxhighlight&amp;gt;This sub-program is invoked for example by&amp;lt;syntaxhighlight lang=&amp;quot;matlab&amp;quot;&amp;gt;plotfunction(&amp;#039;sin&amp;#039;,0,2*pi);&amp;lt;/syntaxhighlight&amp;gt;or&amp;lt;syntaxhighlight lang=&amp;quot;matlab&amp;quot;&amp;gt;plotfunction(@(x)sin(x),0,2*pi);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Recursive Functions ===&lt;br /&gt;
Recursive functions constitute an elegant method to integrate iterative calculations in a simple function expression, that is capable of solving complex tasks. A recursive function calls itself during the sequence of execution of its program code. As can easily be guessed, programming recursive functions involves the risk that a function calls itself over and over again, but never returns to the calling program. Thus, a suiting termination criterion has to be provided, that ensures that after a specific iteration, no further recursion is initiated.&lt;br /&gt;
&lt;br /&gt;
As an example we consider a program implementing a nested intervals method to evaluate the square root of a number x. We begin with an interval in which the sought for square root will certainly be, thus for example &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;[0,x]&amp;lt;/math&amp;gt;. Now we divide the interval in half and check in which half the square root has to be. This half we take as the new interval and call the function anew. The procedure is repeated until the interval is smaller than a given numerical accuracy and the square root is thus determined with sufficient precision:&amp;lt;syntaxhighlight lang=&amp;quot;matlab&amp;quot;&amp;gt;%   recursion_eng.m&lt;br /&gt;
%   ===========&lt;br /&gt;
%   calculates the square root of a variable x&lt;br /&gt;
%   using a recursive nested intervals method.&lt;br /&gt;
%&lt;br /&gt;
%   Invoke: x_sqrt = recursion_eng(x);&lt;br /&gt;
%&lt;br /&gt;
&lt;br /&gt;
function x_sqrt = recursion_eng(x, x_low, x_high)&lt;br /&gt;
&lt;br /&gt;
% no boundaries set? Then set plausible boundaries!&lt;br /&gt;
if ~exist(&amp;#039;x_low&amp;#039;)&lt;br /&gt;
    x_low = 0;&lt;br /&gt;
    x_high = x;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
% Interval bigger than the accuracy of Matlab?&lt;br /&gt;
if (abs(x_low.^2-x) &amp;gt; 4*eps)&lt;br /&gt;
&lt;br /&gt;
    % yes, find the midpoint of the inteval&lt;br /&gt;
    x_mid = (x_high+x_low)/2;&lt;br /&gt;
    if (x_mid^2 &amp;gt; x)&lt;br /&gt;
&lt;br /&gt;
        % the square root is in the lower half...&lt;br /&gt;
        x_sqrt = recursion_eng(x, x_low, x_mid);&lt;br /&gt;
    else&lt;br /&gt;
&lt;br /&gt;
        % the square root is in the upper half...&lt;br /&gt;
        x_sqrt = recursion_eng(x, x_mid, x_high);&lt;br /&gt;
    end&lt;br /&gt;
else&lt;br /&gt;
&lt;br /&gt;
    % ...no, square root is found!&lt;br /&gt;
    x_sqrt = x_low;&lt;br /&gt;
end&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Davrot</name></author>
	</entry>
</feed>