* Bug 16166 fixed: noisegen() obsolete 66/21066/4
Samuel GOUGEON [Sun, 4 Aug 2019 15:09:08 +0000 (17:09 +0200)]
  http://bugzilla.scilab.org/16166

Change-Id: I33c933253a51af9b31273ca6b00dda32f5e18f47

scilab/CHANGES.md
scilab/modules/cacsd/help/en_US/noisegen.xml
scilab/modules/cacsd/help/fr_FR/noisegen.xml
scilab/modules/cacsd/help/ja_JP/noisegen.xml
scilab/modules/cacsd/macros/noisegen.sci
scilab/modules/slint/src/cpp/DeprecatedChecker.cpp

index 5c42877..c2b29e4 100644 (file)
@@ -173,6 +173,7 @@ Obsolete functions or features
 * `%sn()` is obsolete. Please use `ellipj()` instead.
 * `sysdiag()` is obsolete. Please use `blockdiag()` instead.
 * `ric_desc` is obsolete and will be removed from Scilab 6.1.x. Please use `riccati` instead.
+* `noisegen` will be removed from Scilab 6.1.x. Please use `grand()` instead.
 
 
 Removed Functions
@@ -308,6 +309,7 @@ Bug Fixes
 * [#16158](http://bugzilla.scilab.org/show_bug.cgi?id=16158): When a multicolumn array of rationals was displayed wide column per column, columns #2:$ were replaced with its column #2.
 * [#16160](http://bugzilla.scilab.org/show_bug.cgi?id=16160): `ppol` changed values of third input variable.
 * [#16164](http://bugzilla.scilab.org/show_bug.cgi?id=16164): Help pages in elementary_functions/signal_processing were mislocated.
+* [#16166](http://bugzilla.scilab.org/show_bug.cgi?id=16166): `noisegen()` is crooky, even threatening, and very poor. It is tagged as obsolete and will be removed from Scilab 6.1.x.
 * [#16168](http://bugzilla.scilab.org/show_bug.cgi?id=16168): On some Linux installations, `test_run()` always failed.
 * [#16174](http://bugzilla.scilab.org/show_bug.cgi?id=16174): `libraryinfo` yielded 0x0 matrix of strings for libs without macro
 * [#16177](http://bugzilla.scilab.org/show_bug.cgi?id=16177): In the uicontrol help page, the first example was bugged.
index 6081568..4d5c9d5 100644 (file)
@@ -16,7 +16,9 @@
 <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="noisegen">
     <refnamediv>
         <refname>noisegen</refname>
-        <refpurpose>noise generation</refpurpose>
+        <refpurpose>
+            noise generation <emphasis role="bold">(obsolete)</emphasis>
+        </refpurpose>
     </refnamediv>
     <refsynopsisdiv>
         <title>Syntax</title>
     </refsection>
     <refsection>
         <title>Description</title>
+        <warning>
+            <literal>noisegen()</literal> is obsolete. It will be removed from Scilab 6.1.x.
+            Please use grand() instead. Examples (clearer, shorter, and more powerful) follow:
+            <para/>
+            <para>
+            100 10-point wide steps with random amplitudes of normal distribution
+            of mean 1 and standard deviation 0.7:
+            </para>
+            <programlisting role="example"><![CDATA[
+            u = grand(1,100,"nor",1,0.7) .*. ones(1,10);
+            clf, plot(u);
+            ]]></programlisting>
+            <para/>
+            <para>
+            40 15-point wide steps with random amplitudes of uniform distribution in [1 3],
+            with initial level 0.5 and final level hold:
+            </para>
+            <programlisting role="example"><![CDATA[
+            width = 15;
+            u = grand(1,40, "unf", 1, 3) .*. ones(1,width);
+            u = [ones(1,8*width)*0.5, u, ones(1,5*width)*u($)];
+            clf, plot(u);
+            ]]></programlisting>
+        </warning>
         <para>
             <literal>noisegen()</literal> generates a Scilab function <literal>b = Noise(t)</literal>
             where <literal>Noise(t)</literal> is a piecewise constant function
@@ -109,4 +135,16 @@ plot2d2(t, noise);
             </member>
         </simplelist>
     </refsection>
+    <refsection role="history">
+        <title>History</title>
+        <revhistory>
+            <revision>
+                <revnumber>6.1.0</revnumber>
+                <revdescription>
+                    noisegen() is obsolete. It will be removed from Scilab 6.1.x.
+                    Please replace it with grand() and .*.
+                </revdescription>
+            </revision>
+        </revhistory>
+    </refsection>
 </refentry>
index 0917a24..675c070 100644 (file)
@@ -16,7 +16,7 @@
 <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="fr" xml:id="noisegen">
     <refnamediv>
         <refname>noisegen</refname>
-        <refpurpose>génération de bruit</refpurpose>
+        <refpurpose>génération de bruit <emphasis role="bold">(obsolète)</emphasis></refpurpose>
     </refnamediv>
     <refsynopsisdiv>
         <title>Séquence d'appel</title>
     </refsection>
     <refsection>
         <title>Description</title>
+        <warning>
+            <literal>noisegen()</literal> is obsolete. It will be removed from Scilab 6.1.x.
+            Please use grand() instead. Examples (clearer, shorter, and more powerful) follow:
+            <para/>
+            <para>
+            100 10-point wide steps with random amplitudes of normal distribution
+            of mean 1 and standard deviation 0.7:
+            </para>
+            <programlisting role="example"><![CDATA[
+            u = grand(1,100,"nor",1,0.7) .*. ones(1,10);
+            clf, plot(u);
+            ]]></programlisting>
+            <para/>
+            <para>
+            40 15-point wide steps with random amplitudes of uniform distribution in [1 3],
+            with initial level 0.5 and final level hold:
+            </para>
+            <programlisting role="example"><![CDATA[
+            width = 15;
+            u = grand(1,40, "unf", 1, 3) .*. ones(1,width);
+            u = [ones(1,8*width)*0.5, u, ones(1,5*width)*u($)];
+            clf, plot(u);
+            ]]></programlisting>
+        </warning>
         <para>
             <literal>noisegen()</literal> génère une fonction Scilab <literal>b = Noise(t)</literal>
             où <literal>Noise(t)</literal> est une fonction constante par morceaux
@@ -109,4 +133,16 @@ plot2d2(t, noise);
             </member>
         </simplelist>
     </refsection>
+    <refsection role="history">
+        <title>Historique</title>
+        <revhistory>
+            <revision>
+                <revnumber>6.1.0</revnumber>
+                <revdescription>
+                    noisegen() is obsolete. It will be removed from Scilab 6.1.x.
+                    Please replace it with grand() and .*.
+                </revdescription>
+            </revision>
+        </revhistory>
+    </refsection>
 </refentry>
index bcac806..c560cb3 100644 (file)
@@ -16,7 +16,7 @@
 <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="ja" xml:id="noisegen">
     <refnamediv>
         <refname>noisegen</refname>
-        <refpurpose>ノイズ生成</refpurpose>
+        <refpurpose>ノイズ生成 <emphasis role="bold">(obsolete)</emphasis></refpurpose>
     </refnamediv>
     <refsynopsisdiv>
         <title>呼び出し手順</title>
     </refsynopsisdiv>
     <refsection>
         <title>説明</title>
+        <warning>
+            <literal>noisegen()</literal> is obsolete. It will be removed from Scilab 6.1.x.
+            Please use grand() instead. Examples (clearer, shorter, and more powerful) follow:
+            <para/>
+            <para>
+            100 10-point wide steps with random amplitudes of normal distribution
+            of mean 1 and standard deviation 0.7:
+            </para>
+            <programlisting role="example"><![CDATA[
+            u = grand(1,100,"nor",1,0.7) .*. ones(1,10);
+            clf, plot(u);
+            ]]></programlisting>
+            <para/>
+            <para>
+            40 15-point wide steps with random amplitudes of uniform distribution in [1 3],
+            with initial level 0.5 and final level hold:
+            </para>
+            <programlisting role="example"><![CDATA[
+            width = 15;
+            u = grand(1,40, "unf", 1, 3) .*. ones(1,width);
+            u = [ones(1,8*width)*0.5, u, ones(1,5*width)*u($)];
+            clf, plot(u);
+            ]]></programlisting>
+        </warning>
         <para>
             Scilab 関数 <literal>[b]=Noise(t)</literal>を生成します.
             ただし, <literal>Noise(t)</literal>は区分定数関数です
@@ -44,4 +68,16 @@ y=feval(x,Noise);
 plot(x,y);
  ]]></programlisting>
     </refsection>
+    <refsection role="history">
+        <title>履歴</title>
+        <revhistory>
+            <revision>
+                <revnumber>6.1.0</revnumber>
+                <revdescription>
+                    noisegen() is obsolete. It will be removed from Scilab 6.1.x.
+                    Please replace it with grand() and .*.
+                </revdescription>
+            </revision>
+        </revhistory>
+    </refsection>
 </refentry>
index 9b496d5..8905b13 100644 (file)
@@ -19,6 +19,8 @@ function noisegen(pas,Tmax,sig)
     // The function is constant for t<=0 and t>=Tmax.
     //!
 
+    warnobsolete("6.1.x", "grand()")
+
     dua_g=sig*rand(0:pas:Tmax,"n");
     [nn1,nn2]=size(dua_g);
     deff("[b]=Noise(t)","b=dua_g(min(max((t/"+string(Tmax)+...
index e233651..aa373c9 100644 (file)
@@ -110,6 +110,7 @@ std::unordered_map<std::wstring, std::wstring> DeprecatedChecker::initDep()
     map.emplace(L"lstsize", L"size");
     map.emplace(L"nanmin", L"min");
     map.emplace(L"nanmax", L"max");
+    map.emplace(L"noisegen", L"grand");
     map.emplace(L"numer", L".num");
     map.emplace(L"ric_desc", L"riccati");
     map.emplace(L"square", L"replot");