| 1 | <html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Chapter 8. Matrizen in GEL</title><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot"><link rel="home" href="index.html" title="Genius-Handbuch"><link rel="up" href="index.html" title="Genius-Handbuch"><link rel="prev" href="ch07s06.html" title="Laden von Programmen"><link rel="next" href="ch08s02.html" title="Operatoren für konjugierte Transposition und Transposition"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 8. Matrizen in GEL</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch07s06.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="ch08s02.html">Next</a></td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><div><h1 class="title"><a name="genius-gel-matrices"></a>Chapter 8. Matrizen in GEL</h1></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl class="toc"><dt><span class="sect1"><a href="ch08.html#genius-gel-matrix-support">Matrizen eingeben</a></span></dt><dt><span class="sect1"><a href="ch08s02.html">Operatoren für konjugierte Transposition und Transposition</a></span></dt><dt><span class="sect1"><a href="ch08s03.html">Lineare Algebra</a></span></dt></dl></div><p lang="en"> |
| 2 | Genius has support for vectors and matrices and possesses a sizable library of |
| 3 | matrix manipulation and linear algebra functions. |
| 4 | </p><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="genius-gel-matrix-support"></a>Matrizen eingeben</h2></div></div></div><p lang="en"> |
| 5 | To enter matrices, you can use one of the following two syntaxes. You can either enter |
| 6 | the matrix on one line, separating values by commas and rows by semicolons. Or you |
| 7 | can enter each row on one line, separating |
| 8 | values by commas. |
| 9 | You can also just combine the two methods. |
| 10 | So to enter a 3x3 matrix |
| 11 | of numbers 1-9 you could do |
| 12 | </p><pre lang="en" class="programlisting">[1,2,3;4,5,6;7,8,9] |
| 13 | </pre><p lang="en"> |
| 14 | or |
| 15 | </p><pre lang="en" class="programlisting">[1, 2, 3 |
| 16 | 4, 5, 6 |
| 17 | 7, 8, 9] |
| 18 | </pre><p lang="en"> |
| 19 | Do not use both ';' and return at once on the same line though. |
| 20 | </p><p lang="en"> |
| 21 | You can also use the matrix expansion functionality to enter matrices. |
| 22 | For example you can do: |
| 23 | </p><pre lang="en" class="programlisting">a = [ 1, 2, 3 |
| 24 | 4, 5, 6 |
| 25 | 7, 8, 9] |
| 26 | b = [ a, 10 |
| 27 | 11, 12] |
| 28 | </pre><p lang="en"> |
| 29 | and you should get |
| 30 | </p><pre lang="en" class="programlisting">[1, 2, 3, 10 |
| 31 | 4, 5, 6, 10 |
| 32 | 7, 8, 9, 10 |
| 33 | 11, 11, 11, 12] |
| 34 | </pre><p lang="en"> |
| 35 | similarly you can build matrices out of vectors and other stuff like that. |
| 36 | </p><p lang="en"> |
| 37 | Another thing is that non-specified spots are initialized to 0, so |
| 38 | </p><pre lang="en" class="programlisting">[1, 2, 3 |
| 39 | 4, 5 |
| 40 | 6] |
| 41 | </pre><p lang="en"> |
| 42 | will end up being |
| 43 | </p><pre lang="en" class="programlisting"> |
| 44 | [1, 2, 3 |
| 45 | 4, 5, 0 |
| 46 | 6, 0, 0] |
| 47 | </pre><p lang="en"> |
| 48 | </p><p lang="en"> |
| 49 | When matrices are evaluated, they are evaluated and traversed row-wise. This is just |
| 50 | like the <code class="literal">M@(j)</code> operator, which traverses the matrix row-wise. |
| 51 | </p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p lang="en"> |
| 52 | Be careful about using returns for expressions inside the |
| 53 | <code class="literal">[ ]</code> brackets, as they have a slightly different meaning |
| 54 | there. You will start a new row. |
| 55 | </p></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch07s06.html">Prev</a> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="ch08s02.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Laden von Programmen </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Operatoren für konjugierte Transposition und Transposition</td></tr></table></div></body></html> |