/usr/share/doc/octave3.2-headers/examples/addtwomatrices.cc is in octave3.2-headers 3.2.4-12.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | #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 ();
}
|