Add examples for star, equal, comparison, then, TMPDIR, SCI, quote, etc 54/9454/2
Sylvestre Ledru [Tue, 16 Oct 2012 13:28:15 +0000 (15:28 +0200)]
Change-Id: Ia32d2fdf57402c03ca8fa92ec432aa933637820d

21 files changed:
scilab/modules/core/help/en_US/control_flow/if.xml
scilab/modules/core/help/en_US/control_flow/then.xml
scilab/modules/core/help/en_US/keywords/comparison.xml
scilab/modules/core/help/en_US/keywords/equal.xml
scilab/modules/core/help/en_US/keywords/quote.xml
scilab/modules/core/help/en_US/keywords/star.xml
scilab/modules/core/help/en_US/variables/predefined/SCI.xml
scilab/modules/core/help/en_US/variables/predefined/TMPDIR.xml
scilab/modules/core/help/fr_FR/control_flow/then.xml
scilab/modules/core/help/fr_FR/keywords/quote.xml
scilab/modules/core/help/fr_FR/keywords/star.xml
scilab/modules/core/help/ja_JP/control_flow/then.xml
scilab/modules/core/help/ja_JP/keywords/comparison.xml
scilab/modules/core/help/ja_JP/keywords/equal.xml
scilab/modules/core/help/pt_BR/control_flow/then.xml
scilab/modules/core/help/pt_BR/keywords/comparison.xml
scilab/modules/core/help/pt_BR/keywords/equal.xml
scilab/modules/core/help/ru_RU/control_flow/then.xml
scilab/modules/core/help/ru_RU/keywords/comparison.xml
scilab/modules/core/help/ru_RU/keywords/equal.xml
scilab/modules/preferences/help/en_US/preferences.xml

index d53e2f7..393bdb1 100644 (file)
         <title>Examples</title>
         <programlisting role="example"><![CDATA[ 
 i=2
-for j = 1:3, 
+for j = 1:3,
   if i == j then
-    a(i,j) = 2; 
-  elseif abs(i-j) == 1 then 
-    a(i,j) = -1; 
+    a(i,j) = 2;
+  elseif abs(i-j) == 1 then
+    a(i,j) = -1;
   else a(i,j) = 0;
   end,
 end
index 786a317..da5ff52 100644 (file)
             The keyword <literal>then</literal> can be replaced by a carriage return or a comma.
         </para>
     </refsection>
+    <refsection>
+        <title>Examples</title>
+        <programlisting role="example"><![CDATA[
+if 2*2 == 4 then
+   disp("It works")
+end
+
+n=round(10*rand(1,1))
+select n
+    case 0 then
+        disp(0)
+    case 1 then
+        disp(1)
+    else
+      disp(n);
+end
+        ]]></programlisting>
+    </refsection>
+    
     <refsection role="see also">
         <title>See Also</title>
         <simplelist type="inline">
index 32e4278..123c04a 100644 (file)
 (1:5)<=[1 4 2 3 0]
 1<[]
 list(1,2,3)~=list(1,3,3)
+"foo"=="bar"
+sparse([1,2;4,5;3,10],[1,2,3]) == sparse([1,2;4,5;3,10],[1,2,3])
 
 //object wise comparisons
 (1:10)==[4,3]
index 14c30f3..bfa9fe4 100644 (file)
 a = sin(3.2)
 M = [2.1,3.3,8.5;7.6,6.7,6.9;0,6.3,8.8];
 [u,s] = schur(M)
-[1:10] == 4 
+2*2 == 4
+[1:10] == 4
+"foo" == "bar"
+sparse([1,2;4,5;3,10],[1,2,3]) == sparse([1,2;4,5;3,10],[1,2,3])
 1~=2
  ]]></programlisting>
     </refsection>
index ab38710..7ca7315 100644 (file)
@@ -24,7 +24,9 @@
 [1+%i, 2]'
 [1+%i, 2].'
 x='This is a character string'
+x="This is another character string"
 'He said:''Good'''
+'He said:""Very Good""'
  ]]></programlisting>
     </refsection>
     <refsection role="see also">
index 2b33284..709b48c 100644 (file)
         </para>
         <para>
             <literal>A*.B</literal>  is an operator with no predefined meaning. It may be used
-            to define a new operator (see <link linkend="overloading">overloading</link>) with  the same 
-            precedence as <literal>*</literal> or <literal>/</literal>.
+            to define a new operator (see <link linkend="overloading">overloading</link>) with  the same precedence as <literal>*</literal> or <literal>/</literal>.
         </para>
     </refsection>
+    <refsection>
+        <title>Examples</title>
+        <programlisting role="example"><![CDATA[
+// Basic numerical operations
+2 * 2 // 4
+2 * [%pi, %eps] // 6.2831853    4.441D-16
+rand(2,2) * rand(2)
+[1, 2; 3, 4] * [%pi,%eps; %e, %pi]
+ ]]></programlisting>
+        <programlisting role="example"><![CDATA[
+// Polynomial operations
+s=poly(0,"s");
+p=1+s+2*s^2;
+q=1+s+2*s^3;
+p * q
+//               2    3    4    5
+//    1 + 2s + 3s + 4s + 2s + 4s
+ ]]></programlisting>
+        <programlisting role="example"><![CDATA[
+// Rational
+s=poly(0,'s');
+W=[1/s,1/(s+1)];
+W' * W
+//    1           1          
+//    -         -----        
+//     2             2       
+//    s         s + s        
+//                           
+//      1           1        
+//    -----     ---------    
+//         2              2  
+//    s + s     1 + 2s + s   
+ ]]></programlisting>
+    </refsection>
+    
     <refsection role="see also">
         <title>See Also</title>
         <simplelist type="inline">
index 284fc41..fac4918 100644 (file)
             the root path of Scilab.
         </para>
     </refsection>
+    <refsection>
+        <title>Examples</title>
+        <programlisting role="example"><![CDATA[
+ls SCI
+ls(SCI)
+cd(SCI)
+        ]]></programlisting>
+    </refsection>
     <refsection role="see also">
         <title>See Also</title>
         <simplelist type="inline">
index 9a84767..415af67 100644 (file)
             altering the <literal>TMPDIR</literal> system variable.
         </para>
     </refsection>
+    <refsection>
+        <title>Examples</title>
+        <programlisting role="example"><![CDATA[
+ls TMPDIR
+ls(TMPDIR)
+cd(TMPDIR)
+        ]]></programlisting>
+    </refsection>
     <refsection role="see also">
         <title>See Also</title>
         <simplelist type="inline">
index 4a87fbb..c9f457c 100644 (file)
             Le mot-clé <literal>then</literal> peut être remplacé par un retour à la ligne ou une virgule.
         </para>
     </refsection>
+    <refsection>
+        <title>Examples</title>
+        <programlisting role="example"><![CDATA[
+if 2*2 == 4 then
+   disp("Ca marche")
+end
+
+n=round(10*rand(1,1))
+select n
+    case 0 then
+        disp(0)
+    case 1 then
+        disp(1)
+    else
+      disp(n);
+end
+        ]]></programlisting>
+    </refsection>
+    
     <refsection role="see also">
         <title>Voir aussi</title>
         <simplelist type="inline">
index 3dd4206..4d558f6 100644 (file)
@@ -24,7 +24,9 @@
 [1+%i, 2]'
 [1+%i, 2].'
 x='Ceci est une chaîne de caractères'
-'Et Dieu dit : ''que la lumière soit'''
+x="Ceci est une autre chaîne de caractères"
+'Et il dit : ''que la force soit avec toi'''
+'Et il lui répondit : ""que la force soit avec toi""'
  ]]></programlisting>
     </refsection>
     <refsection role="see also">
index 12282d2..035f63b 100644 (file)
             <link linkend="overloading">overloading</link>) avec la même priorité que <literal>*</literal> ou <literal>/</literal>.
         </para>
     </refsection>
+    <refsection>
+        <title>Exemples</title>
+        <programlisting role="example"><![CDATA[
+// Operations classiques
+2 * 2 // 4
+2 * [%pi, %eps] // 6.2831853    4.441D-16
+rand(2,2) * rand(2)
+[1, 2; 3, 4] * [%pi,%eps; %e, %pi]
+ ]]></programlisting>
+        <programlisting role="example"><![CDATA[
+// Opérations sur les polynomes
+s=poly(0,"s");
+p=1+s+2*s^2;
+q=1+s+2*s^3;
+p * q
+//               2    3    4    5
+//    1 + 2s + 3s + 4s + 2s + 4s
+ ]]></programlisting>
+        <programlisting role="example"><![CDATA[
+// Fraction rationnelle
+s=poly(0,'s');
+W=[1/s,1/(s+1)];
+W' * W
+//    1           1          
+//    -         -----        
+//     2             2       
+//    s         s + s        
+//                           
+//      1           1        
+//    -----     ---------    
+//         2              2  
+//    s + s     1 + 2s + s   
+ ]]></programlisting>
+    </refsection>
+    
     <refsection role="see also">
         <title>Voir aussi</title>
         <simplelist type="inline">
index e3a6fc9..de8a0d9 100644 (file)
             <literal>if</literal>と共に使用されます.
         </para>
     </refsection>
+    <refsection>
+        <title>Examples</title>
+        <programlisting role="example"><![CDATA[
+if 2*2 == 4 then
+   disp("It works")
+end
+
+n=round(10*rand(1,1))
+select n
+    case 0 then
+        disp(0)
+    case 1 then
+        disp(1)
+    else
+      disp(n);
+end
+        ]]></programlisting>
+    </refsection>
+    
     <refsection role="see also">
         <title>参照</title>
         <simplelist type="inline">
index 9148fb3..d917629 100644 (file)
 (1:5)<=[1 4 2 3 0]
 1<[]
 list(1,2,3)~=list(1,3,3)
+"foo"=="bar"
+sparse([1,2;4,5;3,10],[1,2,3]) == sparse([1,2;4,5;3,10],[1,2,3])
 
 //オブジェクト毎の比較
 (1:10)==[4,3]
index 58f1402..8ac8edf 100644 (file)
 a = sin(3.2)
 M = [2.1,3.3,8.5;7.6,6.7,6.9;0,6.3,8.8];
 [u,s] = schur(M)
-[1:10] == 4 
+2*2 == 4
+[1:10] == 4
+"foo" == "bar"
+sparse([1,2;4,5;3,10],[1,2,3]) == sparse([1,2;4,5;3,10],[1,2,3])
 1~=2
  ]]></programlisting>
     </refsection>
index 31eec16..2c6c1db 100644 (file)
         </para>
     </refsection>
     <refsection>
+        <title>Examples</title>
+        <programlisting role="example"><![CDATA[
+if 2*2 == 4 then
+   disp("It works")
+end
+
+n=round(10*rand(1,1))
+select n
+    case 0 then
+        disp(0)
+    case 1 then
+        disp(1)
+    else
+      disp(n);
+end
+        ]]></programlisting>
+    </refsection>
+    
+    <refsection>
         <title> Ver Também </title>
         <simplelist type="inline">
             <member>
index d3cc8b3..2f3d10b 100644 (file)
 (1:5)<=[1 4 2 3 0]
 1<[]
 list(1,2,3)~=list(1,3,3)
+"foo"=="bar"
+sparse([1,2;4,5;3,10],[1,2,3]) == sparse([1,2;4,5;3,10],[1,2,3])
 
 //comparações objeto a objeto
 (1:10)==[4,3]
index 813276e..88827fe 100644 (file)
 a = sin(3.2)
 M = [2.1,3.3,8.5;7.6,6.7,6.9;0,6.3,8.8];
 [u,s] = schur(M)
-[1:10] == 4 
+2*2 == 4
+[1:10] == 4
+"foo" == "bar"
+sparse([1,2;4,5;3,10],[1,2,3]) == sparse([1,2;4,5;3,10],[1,2,3])
 1~=2
  ]]></programlisting>
     </refsection>
index afa466c..d557e18 100644 (file)
             Ключевое слово <literal>then</literal> может быть заменено на перевод каретки или запятую.
         </para>
     </refsection>
+    <refsection>
+        <title>Examples</title>
+        <programlisting role="example"><![CDATA[
+if 2*2 == 4 then
+   disp("It works")
+end
+
+n=round(10*rand(1,1))
+select n
+    case 0 then
+        disp(0)
+    case 1 then
+        disp(1)
+    else
+      disp(n);
+end
+        ]]></programlisting>
+    </refsection>
+    
     <refsection role="see also">
         <title>Смотрите также</title>
         <simplelist type="inline">
index f183d9c..c086b65 100644 (file)
 (1:5)<=[1 4 2 3 0]
 1<[]
 list(1,2,3)~=list(1,3,3)
+"foo"=="bar"
+sparse([1,2;4,5;3,10],[1,2,3]) == sparse([1,2;4,5;3,10],[1,2,3])
  
 //пообъектные сравнения
 (1:10)==[4,3]
index daff2eb..c748f72 100644 (file)
 a = sin(3.2)
 M = [2.1,3.3,8.5;7.6,6.7,6.9;0,6.3,8.8];
 [u,s] = schur(M)
-[1:10] == 4 
+2*2 == 4
+[1:10] == 4
+"foo" == "bar"
+sparse([1,2;4,5;3,10],[1,2,3]) == sparse([1,2;4,5;3,10],[1,2,3])
 1~=2
  ]]></programlisting>
     </refsection>
index 255c3c5..29c76bf 100644 (file)
             Open Scilab Preferences window. 
         </para>
     </refsection>
+    <refsection>
+        <title>Examples</title>
+        <programlisting role="example"><![CDATA[
+preferences()
+ ]]></programlisting>
+    </refsection>
     <refsection role="see also">
         <title>See Also</title>
         <simplelist type="inline">