* `{}` and `[]` are now distinct operators. Matrices can no longer be defined using `{}` operators. These are reserved for cell definition.
* Addition, subtraction, and inequality comparisons `<` `<=` `>=` `>` with an empty matrix now returns an empty matrix.
* New `&&` and `||` boolean AND and OR operators are introduced. They are shortcut in expressions even out of conditional tests, like `A = [1 %pi] || det([1 2])`
-* Syntax `%i:10` is now deprecated (only real scalars can be used).
+* The colon `: ` is now such that `type(:)==type(1:$)==129`, `typeof(:)==typeof(1:$)=='implicitlist'`, and `size(:)` is now undefined instead of `[-1,-1]`. In addition, `%i:10` is deprecated: Only real scalars can be used.
* Control and block keywords `break` `case` `catch` `continue` `do` `else` `elseif` `end` endfunction` `for` `function` `if` `resume` `return` `select` `then` `try` and `while` can no longer be overloaded as regular assignable variables as in `end=1`. They are now reserved and protected.
* `else` is no longer supported in a `while ... end` control instruction.
* `end` can no longer be directly followed by an instruction on the line without a `,` or `;` separator.
<literal>[]</literal>.
</para>
</listitem>
- </listitem>
</itemizedlist>
<para>
<warning>
<revision>
<revnumber>6.0</revnumber>
<revdescription>
- <literal>%i:10</literal> now yields an error.
+ <itemizedlist>
+ <listitem>
+ <literal>type(:)</literal> is 129 (as for <literal>1:$</literal>)
+ instead of 1. <literal>size(:)</literal> is undefined
+ (instead of <literal>[-1,-1]</literal>).
+ </listitem>
+ <listitem>
+ <literal>typeof(:)</literal> is now <literal>"implicitlist"</literal>,
+ like <literal>1:$</literal>.
+ </listitem>
+ <listitem>
+ <literal>%i:10</literal> now yields an error.
+ </listitem>
+ </itemizedlist>
</revdescription>
</revision>
</revhistory>
For example, use:
</para>
<programlisting role=""><![CDATA[
- i = 0
- while i<5
- disp("i");
- i = i + 1;
- end
+i = 0;
+while i<5
+ disp(i);
+ i = i + 1;
+end
]]></programlisting>
<para>
rather than
</para>
<programlisting role=""><![CDATA[
- i = 0; while i<5 disp("i"); i = i + 1; end
+i = 0; while i<5, disp(i), i = i + 1; end
]]></programlisting>
<warning>
The number of characters used to define the body of any conditional instruction
<revision>
<revnumber>6.0</revnumber>
<revdescription>
- <literal>%i:10</literal> produit désormais une erreur.
+ <itemizedlist>
+ <listitem>
+ <literal>type(:)</literal> vaut 129 (comme pour <literal>1:$</literal>)
+ au lieu de 1. <literal>size(:)</literal> est indéfinie
+ (au lieu de <literal>[-1,-1]</literal>).
+ </listitem>
+ <listitem>
+ <literal>typeof(:)</literal> est désormais <literal>"implicitlist"</literal>,
+ comme pour <literal>1:$</literal>.
+ </listitem>
+ <listitem>
+ <literal>%i:10</literal> produit désormais une erreur.
+ </listitem>
+ </itemizedlist>
</revdescription>
</revision>
</revhistory>
Par exemple, utiliser :
</para>
<programlisting role=""><![CDATA[
- i = 0
- while i<5
- disp("i");
- i = i + 1;
- end
+i = 0
+while i<5
+ disp(i);
+ i = i + 1;
+end
]]></programlisting>
<para>
rather than
</para>
<programlisting role=""><![CDATA[
- i = 0; while i<5 disp("i"); i = i + 1; end
+i = 0; while i<5, disp(i), i = i + 1; end
]]></programlisting>
<warning>
Le nombre de caractères constituant le corps d'une instruction conditionnelle (if while
<revision>
<revnumber>6.0</revnumber>
<revdescription>
- <literal>%i:10</literal> now yields an error.
+ <itemizedlist>
+ <listitem>
+ <literal>type(:)</literal> is 129 (as for <literal>1:$</literal>)
+ instead of 1. <literal>size(:)</literal> is undefined
+ (instead of <literal>[-1,-1]</literal>).
+ </listitem>
+ <listitem>
+ <literal>typeof(:)</literal> is now <literal>"implicitlist"</literal>,
+ like <literal>1:$</literal>.
+ </listitem>
+ <listitem>
+ <literal>%i:10</literal> now yields an error.
+ </listitem>
+ </itemizedlist>
</revdescription>
</revision>
</revhistory>
例えば以下のようにします:
</para>
<programlisting role=""><![CDATA[
- i = 0
- while i<5
- disp("i");
- i = i + 1;
- end
+i = 0;
+while i<5
+ disp(i);
+ i = i + 1;
+end
]]></programlisting>
<para>
以下は推奨されません.
</para>
<programlisting role=""><![CDATA[
- i = 0; while i<5 disp("i"); i = i + 1; end
+i = 0; while i<5, disp(i), i = i + 1; end
]]></programlisting>
<warning>
条件付き命令(if while for または select/case)の本文を定義するために使用可能な
<revision>
<revnumber>6.0</revnumber>
<revdescription>
- <literal>%i:10</literal> now yields an error.
+ <itemizedlist>
+ <listitem>
+ <literal>type(:)</literal> is 129 (as for <literal>1:$</literal>)
+ instead of 1. <literal>size(:)</literal> is undefined
+ (instead of <literal>[-1,-1]</literal>).
+ </listitem>
+ <listitem>
+ <literal>typeof(:)</literal> is now <literal>"implicitlist"</literal>,
+ like <literal>1:$</literal>.
+ </listitem>
+ <listitem>
+ <literal>%i:10</literal> now yields an error.
+ </listitem>
+ </itemizedlist>
</revdescription>
</revision>
</revhistory>
</para>
</listitem>
</itemizedlist>
+ <para>
+ According to the Code Conventions for the Scilab Programming Language it is recommended:
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ Start each statement on a new line.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Write no more than one simple statement per line.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Break compound statements over multiple lines.
+ </para>
+ </listitem>
+ </itemizedlist>
+ <para>
+ For example, use:
+ </para>
+ <programlisting role=""><![CDATA[
+i = 0;
+while i<5
+ disp(i);
+ i = i + 1;
+end
+]]></programlisting>
+ <para>
+ rather than
+ </para>
+ <programlisting role=""><![CDATA[
+i = 0; while i<5, disp(i), i = i + 1; end
+]]></programlisting>
<warning>
O número de caracateres usados para definir o corpo de qualquer estrutura condicional
(if while for ou select/case) deve ser limitado a 16k.
k=k+1;
end
e,k
-
]]></programlisting>
</refsection>
<refsection>
<title>Описание</title>
<para>
Символ двоеточие <literal>:</literal> может использоваться для того, чтобы явным
- образом формировать векторы (см. также <link linkend="linspace">linspace</link>, <link linkend="logspace">logspace</link>):
+ образом формировать векторы (см. также <link linkend="linspace">linspace</link>,
+ <link linkend="logspace">logspace</link>):
</para>
<variablelist>
<varlistentry>
<revision>
<revnumber>6.0</revnumber>
<revdescription>
- <literal>%i:10</literal> теперь выдаёт ошибку.
+ <itemizedlist>
+ <listitem>
+ <literal>type(:)</literal> равен 129 (как и у <literal>1:$</literal>)
+ вместо 1. <literal>size(:)</literal> неопределён
+ (вместо <literal>[-1,-1]</literal>).
+ </listitem>
+ <listitem>
+ <literal>typeof(:)</literal> теперь <literal>"implicitlist"</literal>,
+ как и у <literal>1:$</literal>.
+ </listitem>
+ <listitem>
+ <literal>%i:10</literal> теперь выдаёт ошибку.
+ </listitem>
+ </itemizedlist>
</revdescription>
</revision>
</revhistory>
Например, используйте:
</para>
<programlisting role=""><![CDATA[
- i = 0
- while i<5
- disp("i");
- i = i + 1;
- end
+i = 0;
+while i<5
+ disp(i);
+ i = i + 1;
+end
]]></programlisting>
<para>
а не:
</para>
<programlisting role=""><![CDATA[
- i = 0; while i<5 disp("i"); i = i + 1; end
+i = 0; while i<5, disp(i), i = i + 1; end
]]></programlisting>
<warning>
число символов, используемых для определения тела любой инструкции условия
<revremark>
<itemizedlist>
<listitem>
- The <literal>[,else instructions]</literal> syntax is no longer supported.
+ Синтаксис <literal>[,else instructions]</literal> более не поддерживается.
</listitem>
<listitem>
- <literal>while</literal> is now protected:
- Assignments like <literal>while=1</literal> are no longer possible.
+ <literal>while</literal> теперь защищено:
+ Назначения вроде <literal>while=1</literal> более недопустимы.
</listitem>
</itemizedlist>
</revremark>
<revision>
<revnumber>6.0</revnumber>
<revdescription>
- <simplelist>
- <member>
- The type 11 is removed. It was used for uncompiled Scilab functions.
- </member>
- <member>
- <literal>type(:)</literal> now returns 129 instead of 1.
- </member>
- </simplelist>
+ The type 11 is removed. It was used for uncompiled Scilab functions.
</revdescription>
</revision>
</revhistory>
typeof "hypermat" removed. Hypermatrices of any homogeneous type are now
natively supported.
</listitem>
- <listitem>typeof "listdelete" and "void" added.</listitem>
- <listitem>
- typeof(:) was "constant" and becomes "implicitlist". typeof(1:$) was
- "size implicit" and become "implicitlist".
+ <listitem>typeof "listdelete" added (as returned by null()).</listitem>
+ <listitem>typeof() can now be used for any undefined element of a list.
+ It then returns the new "void" typeof.
</listitem>
<listitem>
The typeof of T-lists and M-lists were limited to 8 characters. They may
<revision>
<revnumber>6.0</revnumber>
<revdescription>
- <simplelist>
- <member>
- Le type 11 est supprimé. Il était utilisé pour les fonctions Scilab non
- compilées.
- </member>
- <member>
- <literal>type(:)</literal> vaut désormais 129 au lieu de 1.
- </member>
- </simplelist>
+ Le type 11 est supprimé. Il était utilisé pour les fonctions Scilab non compilées.
</revdescription>
</revision>
</revhistory>
de type "simple" homogène est désormais encodée de manière
native.
</listitem>
- <listitem>Ajout des typeof "listdelete" et "void".</listitem>
- <listitem>typeof(:) était "constant" et devient "implicitlist". typeof(1:$) était
- "size implicit" etdevient "implicitlist".
+ <listitem>typeof "listdelete" ajouté (tel que retourné pour null()).</listitem>
+ <listitem>typeof() peut désormais être appliquée aux éléments non définis
+ des listes. Le nouveau typeof "void" est retourné.
</listitem>
+ <listitem>Ajout des typeof "listdelete" et "void".</listitem>
<listitem>Le typeof des T-lists et M-lists était limité à 8 caractères.
Les noms de types peuvent maintenant être plus longs.
</listitem>
<revision>
<revnumber>6.0</revnumber>
<revdescription>
- <simplelist>
- <member>
- The type 11 is removed. It was used for uncompiled Scilab functions.
- </member>
- <member>
- <literal>type(:)</literal> now returns 129 instead of 1.
- </member>
- </simplelist>
+ The type 11 is removed. It was used for uncompiled Scilab functions.
</revdescription>
</revision>
</revhistory>
<revision>
<revnumber>6.0</revnumber>
<revdescription>
- <simplelist>
- <member>
- The type 11 is removed. It was used for uncompiled Scilab functions.
- </member>
- <member>
- <literal>type(:)</literal> now returns 129 instead of 1.
- </member>
- <member>
- Assigning an object of type 0 to a variable no longer deletes this one.
- </member>
- </simplelist>
+ The type 11 is removed. It was used for uncompiled Scilab functions.
</revdescription>
</revision>
</revhistory>
<listitem>typeof "hypermat" removed. Hypermatrices of any homogeneous type are now
natively supported.
</listitem>
- <listitem>typeof "listdelete" and "void" added.</listitem>
- <listitem>typeof(:) was "constant" and becomes "implicitlist". typeof(1:$) was
- "size implicit" and become "implicitlist".
+ <listitem>typeof "listdelete" added (as returned by null()).</listitem>
+ <listitem>typeof() can now be used for any undefined element of a list.
+ It then returns the new "void" typeof.
</listitem>
- <listitem>The typeof of T-lists and M-lists were limited to 8 characters. They may
- be longer now.
+ <listitem>The typeof of T-lists and M-lists were limited to 8 characters.
+ They may be longer now.
</listitem>
<listitem>
typeof "size implicit" renamed "implicitlist" (<literal>1:$</literal>)
<revision>
<revnumber>6.0</revnumber>
<revdescription>
- <simplelist>
- <member>
- Тип 11 был удалён. Он использовался для некомпилировнных Scilab-функций.
- </member>
- <member>
- <literal>type(:)</literal> теперь возвращает 129 вместо 1.
- </member>
- <member>
- Назначение объекта типа 0 переменной больше не удаляет её.
- </member>
- </simplelist>
+ Тип 11 был удалён. Он использовался для некомпилировнных Scilab-функций.
</revdescription>
</revision>
</revhistory>
_LaTeX_erfcx.xml_1.png=3e69185b6882d8edc7e54d751156dc18
_LaTeX_erfcx.xml_2.png=5feafbda8ba8a657c647a355fb122b49
_LaTeX_erfi.xml_1.png=98b6a64c2482c6be60499c854c70a678
-_LaTeX_fft.xml_1.png=30d788e922f7acbb3ef6f5d2d70bb96b
-_LaTeX_fft.xml_2.png=4b7b41681f5cfbcb0af74e4cc3ab99fc
+_LaTeX_fft.xml_1.png=7db5478ba8fb1495b82cd5cbcc0635b8
+_LaTeX_fft.xml_2.png=e2ba0c01769f70471e099f0496a4aef3
_LaTeX_filter.xml_1.png=f5eab130f2e7fd10b80a402952421a05
_LaTeX_floor.xml_ru_RU_1.png=1d5ba78bbbafd3226f371146bc348363
_LaTeX_grand.xml_1.png=dd59088e24bed7a6af5a6ccd16e58616
<listitem>
<para>string, file name of the file to be opened</para>
<warning>
- This function can not open files whose path or/and name have non-ascii
+ This function can not open files whose path has non-ascii
UTF characters (accented, etc). In this case, mopen() must be used.
</warning>
</listitem>
</member>
</simplelist>
</refsection>
+ <refsection role="history">
+ <title>History</title>
+ <revhistory>
+ <revision>
+ <revnumber>6.0.0</revnumber>
+ <revdescription>
+ stderr is inserted in the output of file() as units(1)=0, typ(1)="STD" and
+ nams(1)="stderr".
+ </revdescription>
+ </revision>
+ </revhistory>
+ </refsection>
</refentry>
</member>
</simplelist>
</refsection>
+ <refsection role="history">
+ <title>履歴</title>
+ <revhistory>
+ <revision>
+ <revnumber>6.0.0</revnumber>
+ <revdescription>
+ stderr is inserted in the output of file() as units(1)=0, typ(1)="STD" and
+ nams(1)="stderr".
+ </revdescription>
+ </revision>
+ </revhistory>
+ </refsection>
</refentry>
<listitem>
<para>string, nome o arquivo a ser aberto</para>
<warning>
- This function can not open files whose path or/and name have non-ascii
+ This function can not open files whose path has non-ascii
UTF characters (accented, etc). In this case, please use mopen.
</warning>
</listitem>
</member>
</simplelist>
</refsection>
+ <refsection role="history">
+ <title>Histórico</title>
+ <revhistory>
+ <revision>
+ <revnumber>6.0.0</revnumber>
+ <revdescription>
+ stderr is inserted in the output of file() as units(1)=0, typ(1)="STD" and
+ nams(1)="stderr".
+ </revdescription>
+ </revision>
+ </revhistory>
+ </refsection>
</refentry>
* along with this program.
*
-->
-<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:id="m2sci_atan2">
+<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:id="m2sci_atan2">
<refnamediv>
<refname>atan2 (Matlab function)</refname>
<refpurpose>Four-quadrant inverse tangent</refpurpose>
<tr>
<td>
<programlisting role="example"><![CDATA[
-atan2(y,x)
+atan2(y, x)
+atan2(y, x) % x, y complex
+// No equivalent
]]></programlisting>
</td>
<td>
<programlisting role="example"><![CDATA[
-atan(y,x)
+atan(y, x)
+atan(real(y), real(x))
+atan(y, x) // x, y complex
]]></programlisting>
</td>
</tr>
</informaltable>
</refsection>
- <refsection>
- <title>Particular cases</title>
- <para>
- Matlab <emphasis role="bold">atan2</emphasis> function can work with complexes (in this case, complex part is ignored), what Scilab <emphasis role="bold">atan</emphasis> can not.
- </para>
- </refsection>
</refentry>
* along with this program.
*
-->
-<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:id="m2sci_isletter">
+<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:id="m2sci_isletter">
<refnamediv>
<refname>isletter (Matlab function)</refname>
<refpurpose>True for letters of the alphabet</refpurpose>
</td>
<td>
<programlisting role="example"><![CDATA[
-No equivalent
-]]></programlisting>
- </td>
- </tr>
- </informaltable>
- </refsection>
- <refsection>
- <title>Particular cases</title>
- <para>
- There is no equivalent function to Matlab <emphasis role="bold">isletter</emphasis> function in Scilab. However it can be replaced as follows. Using <emphasis role="bold">mtlb_isletter</emphasis> will give a prettier code.
- </para>
- </refsection>
- <refsection>
- <title>Examples</title>
- <informaltable border="1" width="100%">
- <tr>
- <td align="center">
- <emphasis role="bold">Matlab</emphasis>
- </td>
- <td align="center">
- <emphasis role="bold">Scilab</emphasis>
- </td>
- </tr>
- <tr>
- <td>
- <programlisting role="example"><![CDATA[
-tf = isletter(A)
-]]></programlisting>
- </td>
- <td>
- <programlisting role="example"><![CDATA[
-// If A is a String matrix:
-tf = ((asciimat(A)>=65) & (asciimat(A)<=90)) | ((asciimat(A)>=97) & (asciimat(A)<=122))
-// If A is not a String matrix:
-tf = zeros(A)
+isletter
]]></programlisting>
</td>
</tr>
* along with this program.
*
-->
-<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:id="m2sci_isscalar">
+<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:id="m2sci_isscalar">
<refnamediv>
<refname>isscalar (Matlab function)</refname>
<refpurpose>Determine if input is scalar</refpurpose>
</td>
<td>
<programlisting role="example"><![CDATA[
-sum(length(A))==1
+isscalar(A)
]]></programlisting>
</td>
</tr>
* along with this program.
*
-->
-<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:id="m2sci_strcmp">
+<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:id="m2sci_strcmp">
<refnamediv>
<refname>strcmp (Matlab function)</refname>
<refpurpose>Compare strings</refpurpose>
<tr>
<td>
<programlisting role="example"><![CDATA[
-strcmp(str1,str2)
+strcmp(str1, str2)
]]></programlisting>
</td>
<td>
<programlisting role="example"><![CDATA[
-str1==str2
+strcmp(str1, str2)
]]></programlisting>
</td>
</tr>
<title>Particular cases</title>
<para>
<note>
- Note that <emphasis role="bold">strcmp</emphasis> can be use with not string inputs, in this case Matlab returns <emphasis role="bold">0</emphasis>. Scilab <emphasis role="bold">==</emphasis> will in this case return <emphasis role="bold">%T</emphasis> if both inputs are equal.
+ Note that <emphasis role="bold">strcmp</emphasis> can be use with not string inputs.
+ In this case Matlab returns <emphasis role="bold">0</emphasis>.
</note>
</para>
</refsection>
</para>
<para>
<latex>
- $x(k) = \sum_{m=1}^n {a(m)*e^{-\frac{2i*\pi}{n}(m-1) (k-1)}$
+ $x(k) = \sum_{m=1}^n
+ {a(m) \exp\left(-2 i\pi\frac{(m-1)}{n} (k-1)\right)}$
</latex>
</para>
<para>
<para>
<latex>
$x(k) = \sum_{m=1}^n
- {a(m)*e^{+\frac{2i*\pi}{n} (m-1) (k-1)}$
+ {a(m) \exp\left(+2 i\pi\frac{(m-1)}{n} (k-1)\right)}$
</latex>
</para>
</listitem>
</para>
<para>
<latex>
- $x(k) = \sum_{m=1}^n {a(m)*e^{-\frac{2i*\pi}{n}(m-1) (k-1)}$
+ $x(k) = \sum_{m=1}^n
+ {a(m) \exp\left(-2 i\pi\frac{(m-1)}{n} (k-1)\right)}$
</latex>
</para>
<para>
<latex>
$x(k) = \sum_{m=1}^n
- {a(m)*e^{+\frac{2i*\pi}{n} (m-1) (k-1)}$
+ {a(m) \exp\left(+2 i\pi\frac{(m-1)}{n} (k-1)\right)}$
</latex>
</para>
</listitem>
</para>
<para>
<latex>
- $x(k) = \sum_{m=1}^n {a(m)*e^{-\frac{2i*\pi}{n}(m-1) (k-1)}$
+ $x(k) = \sum_{m=1}^n
+ {a(m) \exp\left(-2 i\pi\frac{(m-1)}{n} (k-1)\right)}$
</latex>
</para>
<para>
<para>
<latex>
$x(k) = \sum_{m=1}^n
- {a(m)*e^{+\frac{2i*\pi}{n} (m-1) (k-1)}$
+ {a(m) \exp\left(+2 i\pi\frac{(m-1)}{n} (k-1)\right)}$
</latex>
</para>
</listitem>