Mercurial > hg > octave-nkf
comparison examples/code/paramdemo.cc @ 19225:c8240a60dd01
Add penny.mat to build system.
* examples/data/penny.mat: New example data file.
* examples/data/Makefile.am: Automake file for new directory of example data files.
* examples/Makefile.am: Change to be just a pass-through to the subdirectories
code/ and data/.
* examples/@FIRfilter/FIRfilter.m, examples/@FIRfilter/FIRfilter_aggregation.m,
examples/@FIRfilter/display.m, examples/@FIRfilter/module.mk,
examples/@FIRfilter/subsasgn.m, examples/@FIRfilter/subsref.m,
examples/@polynomial/display.m, examples/@polynomial/double.m,
examples/@polynomial/end.m, examples/@polynomial/get.m,
examples/@polynomial/module.mk, examples/@polynomial/mtimes.m,
examples/@polynomial/numel.m, examples/@polynomial/plot.m,
examples/@polynomial/polynomial.m,
examples/@polynomial/polynomial_superiorto.m, examples/@polynomial/polyval.m,
examples/@polynomial/roots.m, examples/@polynomial/set.m,
examples/@polynomial/subsasgn.m, examples/@polynomial/subsref.m,
examples/COPYING, examples/addtwomatrices.cc, examples/celldemo.cc,
examples/embedded.cc, examples/fortrandemo.cc, examples/fortransub.f,
examples/funcdemo.cc, examples/globaldemo.cc, examples/helloworld.cc,
examples/make_int.cc, examples/mex_demo.c, examples/mycell.c,
examples/myfeval.c, examples/myfevalf.f, examples/myfunc.c, examples/myhello.c,
examples/mypow2.c, examples/myprop.c, examples/myset.c, examples/mysparse.c,
examples/mystring.c, examples/mystruct.c, examples/oct_demo.cc,
examples/oregonator.cc, examples/oregonator.m, examples/paramdemo.cc,
examples/standalone.cc, examples/standalonebuiltin.cc, examples/stringdemo.cc,
examples/structdemo.cc, examples/unwinddemo.cc:
Move current example files to examples/code/ directory.
* configure.ac: Add Makefiles in examples/code and examples/data directories.
* build-aux/common.mk: Define octdatadir variable.
* doc/interpreter/Makefile.am: Change location of External Code Interface
examples to examples/code directory.
* doc/interpreter/munge-texi.pl: Expand EXAMPLEFILE macro to examples/code
directory.
author | Rik <rik@octave.org> |
---|---|
date | Tue, 19 Aug 2014 14:32:44 -0700 |
parents | examples/paramdemo.cc@be41c30bcb44 |
children | 2f8500ca91d3 |
comparison
equal
deleted
inserted
replaced
19224:d902542221c8 | 19225:c8240a60dd01 |
---|---|
1 #include <octave/oct.h> | |
2 | |
3 DEFUN_DLD (paramdemo, args, nargout, "Parameter Check Demo") | |
4 { | |
5 octave_value retval; | |
6 int nargin = args.length (); | |
7 | |
8 if (nargin != 1) | |
9 print_usage (); | |
10 else if (nargout != 0) | |
11 error ("paramdemo: OUTPUT argument required"); | |
12 else | |
13 { | |
14 NDArray m = args(0).array_value (); | |
15 double min_val = -10.0; | |
16 double max_val = 10.0; | |
17 octave_stdout << "Properties of input array:\n"; | |
18 if (m.any_element_is_negative ()) | |
19 octave_stdout << " includes negative values\n"; | |
20 if (m.any_element_is_inf_or_nan ()) | |
21 octave_stdout << " includes Inf or NaN values\n"; | |
22 if (m.any_element_not_one_or_zero ()) | |
23 octave_stdout << " includes other values than 1 and 0\n"; | |
24 if (m.all_elements_are_int_or_inf_or_nan ()) | |
25 octave_stdout << " includes only int, Inf or NaN values\n"; | |
26 if (m.all_integers (min_val, max_val)) | |
27 octave_stdout << " includes only integers in [-10,10]\n"; | |
28 } | |
29 return retval; | |
30 } |