<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
<!DOCTYPE MAN SYSTEM "../../manrev.dtd">
<MAN>
  <LANGUAGE>eng</LANGUAGE>
  <TITLE>nansum</TITLE>
  <TYPE>Scilab Function  </TYPE>
  <DATE>10-Sep-2003</DATE>
  <SHORT_DESCRIPTION name="nansum">  Sum of values ignoring NAN's</SHORT_DESCRIPTION>

  <CALLING_SEQUENCE>
  <CALLING_SEQUENCE_ITEM>s = nansum(x,orient)</CALLING_SEQUENCE_ITEM>
  </CALLING_SEQUENCE>

  <PARAM>
  <PARAM_INDENT>

    <PARAM_ITEM>
    <PARAM_NAME>x</PARAM_NAME>
    <PARAM_DESCRIPTION>
       <SP>: numerical vector or matrix.</SP>
    </PARAM_DESCRIPTION>
    </PARAM_ITEM>

    <PARAM_ITEM>
    <PARAM_NAME>orient</PARAM_NAME>
    <PARAM_DESCRIPTION>
       <SP>: nothing or '*'.
         'r' or 1.
         'c' or 2.</SP>
    </PARAM_DESCRIPTION>
    </PARAM_ITEM>

    <PARAM_ITEM>
    <PARAM_NAME>s</PARAM_NAME>
    <PARAM_DESCRIPTION>
      <SP> : Numerical scalar or vector containig the value of the adding operation.</SP>
    </PARAM_DESCRIPTION>
    </PARAM_ITEM>
  </PARAM_INDENT>
  </PARAM>
 
  <DESCRIPTION>
<P>
   This function returns in s the sum of the values (ignoring
   the NAN's) of a numerical vector or matrix x.
   </P>
<P>
   For a vector or matrix x, s=nansum(x) (or s=nansum(x,'*'))
   returns in  scalar s the sum of values of all entries 
   (ignoring the NAN's) of a vector or matrix x.
   </P>
<P>
   s=nansum(x,'r')(or,  equivalently,  s=nansum(x,1)) returns
   in each  entry of the  row vector s of  type 1xsize(x,'c')
   the sum of each column of x (ignoring the NANs).
</P>
<P>
   s=nansum(x,'c')(or,  equivalently,  s=nansum(x,2)) returns
   in each entry of the column vector s of type size(x,'c')x1
   the sum of each row of x (ignoring the NANs).
</P>
<P>
   For the  last two cases,  if a row  or column is  in whole
   composed of NAN, the corresponding place of s will contain
   a NAN.
</P>
  </DESCRIPTION>

  <EXAMPLE><![CDATA[
    x=[0.2113249 %nan 0.6653811;0.7560439 0.3303271 0.6283918]
    m=nansum(x)
    m=nansum(x,1)
    m=nansum(x,2)
  ]]></EXAMPLE>

  <SEE_ALSO>
    <SEE_ALSO_ITEM> <LINK> nancumsum</LINK> </SEE_ALSO_ITEM>
    <SEE_ALSO_ITEM> <LINK> sum</LINK> </SEE_ALSO_ITEM>
  </SEE_ALSO>
  <AUTHOR>
    Carlos Klimann
  </AUTHOR>
  <BIBLIO>
    <P>
    Wonacott,  T.H. and  Wonacott, R.J.; Introductory Statistics,
    5th edition, J.Wiley and Sons, 1990.</P>

  </BIBLIO>


</MAN>
