b15b02c8e884a4e6968c20c41bf17bb308c2f9c2
[scilab.git] / scilab / modules / core / help / en_US / 1_keywords / star.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="en" xml:id="star">
3     <refnamediv>
4         <refname>star</refname>
5         <refpurpose>(*) multiplication operator</refpurpose>
6     </refnamediv>
7     <refsection>
8         <title>Description</title>
9         <para>
10             Multiplication. Usual meaning. Valid for constant,
11             boolean, polynomial, rational matrices and for <literal>syslin</literal> lists (the meaning is series connection).
12         </para>
13         <para>
14             Element-wise multiplication is denoted <literal>x.*y</literal>. If
15             <literal>x</literal> or <literal>y</literal> is scalar (1x1 matrix) <literal> .* </literal>
16             is the same as <literal>*</literal>.
17         </para>
18         <para>
19             Kronecker product is <literal>x.*.y</literal>.
20         </para>
21         <para>
22             <literal>A*.B</literal>  is an operator with no predefined meaning. It may be used
23             to define a new operator (see <link linkend="overloading">overloading</link>) with  the same precedence as <literal>*</literal> or <literal>/</literal>.
24         </para>
25     </refsection>
26     <refsection>
27         <title>Examples</title>
28         <programlisting role="example"><![CDATA[
29 // Basic numerical operations
30 2 * 2 // 4
31 2 * [%pi, %eps] // 6.2831853    4.441D-16
32 rand(2,2) * rand(2)
33 [1, 2; 3, 4] * [%pi,%eps; %e, %pi]
34  ]]></programlisting>
35         <programlisting role="example"><![CDATA[
36 // Polynomial operations
37 s=poly(0,"s");
38 p=1+s+2*s^2;
39 q=1+s+2*s^3;
40 p * q
41 //               2    3    4    5
42 //    1 + 2s + 3s + 4s + 2s + 4s
43  ]]></programlisting>
44         <programlisting role="example"><![CDATA[
45 // Rational
46 s=poly(0,'s');
47 W=[1/s,1/(s+1)];
48 W' * W
49 //    1           1          
50 //    -         -----        
51 //     2             2       
52 //    s         s + s        
53 //                           
54 //      1           1        
55 //    -----     ---------    
56 //         2              2  
57 //    s + s     1 + 2s + s   
58  ]]></programlisting>
59     </refsection>
60     
61     <refsection role="see also">
62         <title>See Also</title>
63         <simplelist type="inline">
64             <member>
65                 <link linkend="dot">dot</link>
66             </member>
67             <member>
68                 <link linkend="slash">slash</link>
69             </member>
70             <member>
71                 <link linkend="backslash">backslash</link>
72             </member>
73             <member>
74                 <link linkend="syslin">syslin</link>
75             </member>
76             <member>
77                 <link linkend="overloading">overloading</link>
78             </member>
79         </simplelist>
80     </refsection>
81 </refentry>