fc77ced1ad7c975a160e54e3d03b4d360f09718b
[scilab.git] / scilab / modules / graphics / help / en_US / 3d_plot / eval3d.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
4  * Copyright (C) INRIA - Serge Steer
5  * 
6  * Copyright (C) 2012 - 2016 - Scilab Enterprises
7  *
8  * This file is hereby licensed under the terms of the GNU GPL v2.0,
9  * pursuant to article 5.3.4 of the CeCILL v.2.1.
10  * This file was originally licensed under the terms of the CeCILL v2.1,
11  * and continues to be available under such terms.
12  * For more information, see the COPYING file which you should have received
13  * along with this program.
14  *
15  -->
16 <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="eval3d">
17     <refnamediv>
18         <refname>eval3d</refname>
19         <refpurpose>values of a function on a grid</refpurpose>
20     </refnamediv>
21     <refsynopsisdiv>
22         <title>Syntax</title>
23         <synopsis>[z]=eval3d(fun,x,[y])</synopsis>
24     </refsynopsisdiv>
25     <refsection>
26         <title>Arguments</title>
27         <variablelist>
28             <varlistentry>
29                 <term>fun</term>
30                 <listitem>
31                     <para>function accepting vectors as arguments.</para>
32                 </listitem>
33             </varlistentry>
34             <varlistentry>
35                 <term>x,y</term>
36                 <listitem>
37                     <para>
38                         2 vectors of size (1,n1) and (1,n2). (default value for <literal>y</literal> : <literal>y=x</literal>).
39                     </para>
40                 </listitem>
41             </varlistentry>
42             <varlistentry>
43                 <term>z</term>
44                 <listitem>
45                     <para>matrix of size (n1,n2).</para>
46                 </listitem>
47             </varlistentry>
48         </variablelist>
49     </refsection>
50     <refsection>
51         <title>Description</title>
52         <para>
53             This function returns a matrix <literal>z(n1,n2)</literal>. <literal>z(i,j)=fun(x(i),y(j))</literal>. 
54             If the function <literal>fun</literal> does not accept arguments of type vector use the
55             primitive <literal>feval</literal>.
56         </para>
57     </refsection>
58     <refsection>
59         <title>Examples</title>
60         <programlisting role="example"><![CDATA[ 
61 x=-5:5;y=x;
62 deff('[z]=f(x,y)',['z= x.*y']);
63 z=eval3d(f,x,y);
64 plot3d(x,y,z);
65
66 deff('[z]=f(x,y)',['z= x*y']);
67 z=feval(x,y,f);
68 plot3d(x,y,z);
69  ]]></programlisting>
70         <scilab:image>x=-5:5;y=x;
71             deff('[z]=f(x,y)',['z= x.*y']);
72             z=eval3d(f,x,y);
73             plot3d(x,y,z);
74         </scilab:image>
75         
76     </refsection>
77     <refsection role="see also">
78         <title>See also</title>
79         <simplelist type="inline">
80             <member>
81                 <link linkend="feval">feval</link>
82             </member>
83         </simplelist>
84     </refsection>
85 </refentry>