<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
<!DOCTYPE MAN SYSTEM "../../manrev.dtd">
<MAN>
  <LANGUAGE>eng</LANGUAGE>
  <TITLE>deff</TITLE>
  <TYPE>Scilab Function</TYPE>
  <DATE>April 1993</DATE>
  <SHORT_DESCRIPTION name="deff"> on-line definition of function</SHORT_DESCRIPTION>
  <CALLING_SEQUENCE>
    <CALLING_SEQUENCE_ITEM>deff('[s1,s2,...]=newfunction(e1,e2,....)',text [,opt])  </CALLING_SEQUENCE_ITEM>
  </CALLING_SEQUENCE>
  <PARAM>
    <PARAM_INDENT>
      <PARAM_ITEM>
        <PARAM_NAME>e1,e2,...,  </PARAM_NAME>
        <PARAM_DESCRIPTION>
          <SP>: input variables.</SP>
        </PARAM_DESCRIPTION>
      </PARAM_ITEM>
      <PARAM_ITEM>
        <PARAM_NAME>s1,s2,...,  </PARAM_NAME>
        <PARAM_DESCRIPTION>
          <SP>: output variables.</SP>
        </PARAM_DESCRIPTION>
      </PARAM_ITEM>
      <PARAM_ITEM>
        <PARAM_NAME>text</PARAM_NAME>
        <PARAM_DESCRIPTION>
          <SP>: matrix of character strings</SP>
        </PARAM_DESCRIPTION>
      </PARAM_ITEM>
      <PARAM_ITEM>
        <PARAM_NAME>opt</PARAM_NAME>
        <PARAM_DESCRIPTION>
          <SP>: optional character string</SP>
          <PARAM_INDENT>
            <PARAM_ITEM>
              <PARAM_NAME>'c'  </PARAM_NAME>
              <PARAM_DESCRIPTION>
                <SP>: function is &quot;compiled&quot; to be more efficient (default)</SP>
              </PARAM_DESCRIPTION>
            </PARAM_ITEM>
            <PARAM_ITEM>
              <PARAM_NAME>'n'  </PARAM_NAME>
              <PARAM_DESCRIPTION>
                <SP>: function is not &quot;compiled&quot;</SP>
              </PARAM_DESCRIPTION>
            </PARAM_ITEM>
          </PARAM_INDENT>
        </PARAM_DESCRIPTION>
      </PARAM_ITEM>
    </PARAM_INDENT>
  </PARAM>
  <DESCRIPTION>
    <P>
    On-line definition of function (user defined function): the name of the 
    created function is <VERB>newfunction</VERB>.
    <VERB>text</VERB> is a sequence of instructions usually set as a vector of 
    character strings.</P>
    <P>
    This command can be used inside a function and the new function
    can be an input or output of any other function.</P>
    <P>
    Usually, functions are defined in a file and loaded into Scilab by
    <VERB>getf</VERB></P>
    <P>
    Some time, in particular when you want to use define strings within
    <VERB>deff</VERB> <VERB>text</VERB> is rather difficult to write. A more tractable
    way may be to define your function in a file as usual, to load it into
    Scilab by <VERB>getf</VERB> (without <VERB>'c'</VERB>  option) and use sci2exp to
    get corresponding <VERB>deff</VERB> instructions.</P>
  </DESCRIPTION>
  <EXAMPLE>
<![CDATA[
deff('[x]=myplus(y,z)','x=y+z')
//
deff('[x]=mymacro(y,z)',['a=3*y+1'; 'x=a*z+y'])
 ]]>
  </EXAMPLE>
  <SEE_ALSO>
    <SEE_ALSO_ITEM>
      <LINK>getf</LINK>
    </SEE_ALSO_ITEM>
    <SEE_ALSO_ITEM>
      <LINK>comp</LINK>
    </SEE_ALSO_ITEM>
    <SEE_ALSO_ITEM>
      <LINK>exec</LINK>
    </SEE_ALSO_ITEM>
    <SEE_ALSO_ITEM>
      <LINK>function</LINK>
    </SEE_ALSO_ITEM>
  </SEE_ALSO>
</MAN>
