view examples/addtwomatrices.cc @ 14348:95c43fc8dbe1 stable rc-3-6-1-0

3.6.1 release candidate 0 * configure.ac (AC_INIT): Version is now 3.6.1-rc0. (OCTAVE_RELEASE_DATE): Now 2012-02-07. * liboctave/Makefile.am: Bump liboctave revision version. * src/Makefile.am: Bump liboctave revision version.
author John W. Eaton <jwe@octave.org>
date Thu, 09 Feb 2012 11:25:04 -0500
parents 4295d634797d
children be41c30bcb44
line wrap: on
line source

#include <octave/oct.h>

DEFUN_DLD (addtwomatrices, args, , "Add A to B")
{
  int nargin = args.length ();
  if (nargin != 2)
    print_usage ();
  else
    {
      NDArray A = args(0).array_value ();
      NDArray B = args(1).array_value ();
      if (! error_state)
        return octave_value (A + B);
    }
  return octave_value_list ();
}