<?xml version="1.0" encoding="ISO-8859-1"?><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" version="5.0-subset Scilab" xml:lang="en" xml:id="plq_eval"><info><pubdate>04-Apr-2006</pubdate></info><refnamediv><refname>plq_eval</refname><refpurpose>Piecewise linear quadratic (plq), evaluate a plq function on a grid</refpurpose></refnamediv>
  
   
  
   
  
   
  
   
  
   

  
   <refsynopsisdiv><title>Calling Sequence</title><synopsis>[y, k] = plq_eval(plqf,X)</synopsis></refsynopsisdiv>

  
   <refsection><title>Parameters</title>
	  
      <variablelist>
		  
         <varlistentry>
			  
            <term>plqf</term>
			  
            <listitem>
				  
               <para>matrix. A plq function with dimensions n x 4.
				  </para>
			  
            </listitem>
		  
         </varlistentry>
		  
         <varlistentry>
			  
            <term>X</term>
			  
            <listitem>
				  
               <para>column vector. A grid of points on which the function is sampled.
				  </para>
			  
            </listitem>
		  
         </varlistentry>
		  
         <varlistentry>
			  
            <term>y</term>
			  
            <listitem>
				  
               <para>column vector. A grid of points on which the plq function is evaluated on.
				  </para>
			  
            </listitem>
		  
         </varlistentry>
		  
         <varlistentry>
			  
            <term>k</term>
			  
            <listitem>
				  
               <para>matrix. A 3 x n matrix with information about which pieces of the plq function contained which X points.
				  </para>
			  
            </listitem>
		  
         </varlistentry>
	  
      </variablelist>
  
   </refsection>
 
  
   <refsection><title>Description</title>
     
         <para>
	     Evaluates a plq function on a grid. This function is necessary as it allows the plq functions to be simplified into more manageable data with scilab functions such as plotting.  
     </para>
     
         <para>
       k is a matrix shaped like the following, with a column for each unique piece of the plq function an X value was in.  For the i'th unique piece, the values X(L(i):R(i)) were evaluated using the I(i)'th row of the plq function.
<!--<programlisting><![CDATA[
        [I(0)    I(1)    ...     I(n-1)  I(n) ]
        [L(0)    L(1)    ...     L(n-1)  L(n) ]
        [R(0)    R(1)    ...     R(n-1)  R(n) ]

]]></programlisting>-->
			<para>
				<inlinemediaobject>
					<imageobject>
						<imagedata fileref="plq_ImagesOfEquationsByLatex/plq_eval/plq_eval_1.png"/>
					</imageobject>
				</inlinemediaobject>
			</para>
     
         </para>
 	
   </refsection>

  
   <refsection><title>Examples</title><programlisting role="example"><![CDATA[
//Example 1
X=[1;2;4;5;7;8;9];
plqf=[3,0.5,0,0;6,0,0,0;%inf,0,1,0];
[y,k] = plq_eval(plqf,X);

//Example 2
x=linspace(0,4)';
plqf = build_plq(x,exp,exp);
y=plq_eval(plqf,x);
  ]]></programlisting></refsection>


   <refsection><title>See Also</title><simplelist type="inline">	
    
      <member>
         <link linkend="plq_function">plq_function</link>
      </member>

   </simplelist></refsection>

  
   <refsection><title>Authors</title><para>
	  
      <literal>Yves Lucet</literal>, University of British Columbia, BC, Canada
  </para></refsection>

</refentry>