view examples/addtwomatrices.cc @ 17296:88a6f2f540ad

io.tst: Condition load-save test on HAVE_ZLIB * test/io.tst: Condition load-save test on HAVE_ZLIB since testls tests file formats that require zlib compression.
author Mike Miller <mtmiller@ieee.org>
date Tue, 20 Aug 2013 09:48:52 -0400
parents be41c30bcb44
children
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 ();
}