<?xml version="1.0" encoding="UTF-8"?>
<!--
 * Scilab ( https://www.scilab.org/ ) - This file is part of Scilab
 * Copyright (C) 2008 - INRIA
 *
 * Copyright (C) 2012 - 2016 - Scilab Enterprises
 *
 * This file is hereby licensed under the terms of the GNU GPL v2.0,
 * pursuant to article 5.3.4 of the CeCILL v.2.1.
 * This file was originally licensed under the terms of the CeCILL v2.1,
 * and continues to be available under such terms.
 * For more information, see the COPYING file which you should have received
 * 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:lang="en" xml:id="demo_function_choice">
    <refnamediv>
        <refname>demo_function_choice</refname>
        <refpurpose>choose and execute an item within a list </refpurpose>
    </refnamediv>
    <refsynopsisdiv>
        <title>Syntax</title>
        <synopsis>demo_function_choice()</synopsis>
    </refsynopsisdiv>
    <refsection>
        <title>Description</title>
        <para>
            The function demo_function_choice choose and execute an item chosen in the
            variable 'demolist' that shall appear above.
            The variable 'demolist' is a text matrix whose first column contains item names
            displayed in an options window and whose second column contains the function that will
            be called. The title of the options window is 'Choose a demo'.
            If the options window is cancelled, the console is put back to its previous
            width.
        </para>
    </refsection>
    <refsection>
        <title>Examples</title>
        <programlisting role="example"><![CDATA[
demolist=[
	'Simulation of a binomial random variable','clf();BinomialT();';
	'Simulation of a discrete random variable','clf();RndDiscT();';
	'Simulation of a geometric random variable','clf();GeomT(1000);';
	'Simulation of a Poisson random variable','clf();PoissonT() ;';
	'Simulation of an exponential random variable','clf();ExpT();';
	'Simulation of a Weibull random variable','clf();WeibullT();';
	'Simulation of a hyper geometric random variable','clf();HyperGeomT();';
	'Simulation of an Erlang random variable','clf();ErlangT();'];

demo_function_choice();
 ]]></programlisting>
    </refsection>
    <refsection role="see also">
        <title>See also</title>
        <simplelist type="inline">
            <member>
                <link linkend="demo_file_choice">demo_file_choice</link>
            </member>
        </simplelist>
    </refsection>
</refentry>
