Mercurial > hg > octave-nkf
annotate examples/unwinddemo.cc @ 10763:b397b8edd8c5
fix off-by-1 dim in scalar map horzcat/vertcat
author | Jaroslav Hajek <highegg@gmail.com> |
---|---|
date | Fri, 02 Jul 2010 08:10:57 +0200 |
parents | 6cb30a539481 |
children | db1f49eaba6b |
rev | line source |
---|---|
6572 | 1 #include <octave/oct.h> |
2 #include <octave/unwind-prot.h> | |
3 | |
4 void | |
5 err_hand (const char *fmt, ...) | |
6 { | |
7 // Do nothing!! | |
8 } | |
9 | |
10 DEFUN_DLD (unwinddemo, args, nargout, "Unwind Demo") | |
11 { | |
12 int nargin = args.length(); | |
13 octave_value retval; | |
14 if (nargin < 2) | |
15 print_usage (); | |
16 else | |
17 { | |
18 NDArray a = args(0).array_value (); | |
19 NDArray b = args(1).array_value (); | |
20 | |
21 if (! error_state) | |
22 { | |
23 unwind_protect::begin_frame ("Funwinddemo"); | |
7081 | 24 unwind_protect_ptr |
9932
6cb30a539481
untabify files in examples directory
John W. Eaton <jwe@octave.org>
parents:
9053
diff
changeset
|
25 (current_liboctave_warning_handler); |
6572 | 26 set_liboctave_warning_handler(err_hand); |
27 retval = octave_value (quotient (a, b)); | |
28 unwind_protect::run_frame ("Funwinddemo"); | |
29 } | |
30 } | |
31 return retval; | |
32 } |