1 <?xml version="1.0" encoding="UTF-8"?>
3     <refnamediv>
4         <refname>slash</refname>
5         <refpurpose>(/) right division and feed back</refpurpose>
6     </refnamediv>
7     <refsection>
8         <title>Description</title>
9         <para>
10             Right division: <code>X=A/B</code> is the solution of <code>X*B=A</code>.
11         </para>
12         <para>
13             The slash (right division) and backslash (left division) operators are linked by the following equation:
14             <code>B/A=(A'\B')'</code>.
15         </para>
16         <para>
17             In the case where <literal>A</literal> is square, the
18             solution <literal>X</literal> can be computed either from LU
19             factorization or from a linear least squares solver. If the
20             condition number of <literal>A</literal> is smaller than
21             <code>1/(10*%eps)</code> (i.e. if <literal>A</literal> is
22             well conditioned), the LU factorization with row pivoting is
23             used. If not (i.e. if <literal>A</literal> is poorly
24             conditioned), then <literal>X</literal> is the minimum-norm
25             solution which minimizes <literal>||A*X-B||</literal> using
26             a complete orthogonal factorization of <literal>A</literal>
27             (i.e. <literal>X</literal> is the solution of a linear least
28             squares problem).
29         </para>
30         <para>
31             <code>A./B</code> is the element-wise right division, i.e.
32             the matrix with entries <literal>A(i,j)/B(i,j)</literal>.
33             If <literal>B</literal> is scalar (1x1 matrix) this
34             operation is the same as <code>A./B*ones(A)</code>. Same
35             convention if <literal>A</literal> is a scalar.
36         </para>
37         <para>
38             <note>
39                 Remark that <code>123./B</code> is interpreted as
40                 <code>(123.)/B</code>. In this cases dot is part of the
41                 number not of the operator.
42             </note>
43         </para>
44         <para>
45             System feed back.  <code>S = G/.K</code> evaluates
46             <code>S = G*(eye() + K*G)^(-1)</code> this operator avoid
47             simplification problem.
48         </para>
49         <para>
50             <note>
51                 Remark that <code>G/.5</code> is interpreted as
52                 <code>G/(.5)</code>. In such cases dot is part of the
53                 number, not of the operator.
54             </note>
55         </para>
56         <para>
57             Comment <code>//</code> comments a line i.e. lines which
58             begin by <code>//</code> are ignored by the interpreter.
59         </para>
60         <para>
61             It is the same with <code>/*</code> which start to comment a
62             block of code and with <code>*/</code> which end to comment this block.
63         </para>
64     </refsection>
65     <refsection>
66         <title>Examples</title>
67         <programlisting role="example"><![CDATA[
68 a=[3.,-24.,30.];
69 B=[
70    9.   -36.    30.
71   -36.   192.  -180.
72    30.  -180.   180.
73 ];
74 x=a/B
75 x*B-a // close to zero
77 a=4 / 2; // Should be 2
78 a=2 ./ [2,4]; //     1.    0.5
79 // Comments are good. They help to understand code
80 /* Even long, that is to say on many lines,
82  ]]></programlisting>
83     </refsection>
84     <refsection role="see also">
85         <title>See Also</title>
86         <simplelist type="inline">
87             <member>
89             </member>
90             <member>
92             </member>
93             <member>
95             </member>
96         </simplelist>
97     </refsection>
98     <refsection>
99         <title>History</title>
100         <revhistory>
101             <revision>
102                 <revnumber>5.4.1</revnumber>
103                 <revremark>
104                     The threshold level for conditioning in slash increased.
105                 </revremark>
106             </revision>
107         </revhistory>
108     </refsection>
110 </refentry>