view examples/addtwomatrices.cc @ 12543:f60f755ebfe4

Add do_braindead_shortcircuit_evaluation to documentation.
author Rik <octave@nomad.inbox5.com>
date Sun, 27 Mar 2011 20:32:29 -0700
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 ();
}