Mercurial > octave
annotate examples/celldemo.cc @ 17692:38cf56b77274
Overhaul image, imagesc to use newplot and support low-level invocation form.
* scripts/image/image.m: New variable do_new indicates high-level calling form.
For high-level invocation, call newplot before __img__. Correct linearity check
if vectors are reversed (high-to-low values). Only apply image properties to axes
if doing a high-level invocation.
* scripts/image/imagesc.m: New variable do_new indicates high-level calling form.
Delete subfunction __imagesc__ and incorporate minimal amount of code into imagesc.
Only apply climits for high-level invocation.
author | Rik <rik@octave.org> |
---|---|
date | Fri, 18 Oct 2013 16:27:44 -0700 |
parents | be41c30bcb44 |
children |
rev | line source |
---|---|
6572 | 1 #include <octave/oct.h> |
2 #include <octave/Cell.h> | |
3 | |
12174 | 4 DEFUN_DLD (celldemo, args, , "Cell Demo") |
6572 | 5 { |
6 octave_value_list retval; | |
7 int nargin = args.length (); | |
8 | |
9 if (nargin != 1) | |
10 print_usage (); | |
11 else | |
12 { | |
16867
be41c30bcb44
Re-write documentation and all examples of dynamically linked functions.
Rik <rik@octave.org>
parents:
12174
diff
changeset
|
13 Cell c = args(0).cell_value (); |
6572 | 14 if (! error_state) |
16867
be41c30bcb44
Re-write documentation and all examples of dynamically linked functions.
Rik <rik@octave.org>
parents:
12174
diff
changeset
|
15 for (octave_idx_type i = 0; i < c.numel (); i++) |
be41c30bcb44
Re-write documentation and all examples of dynamically linked functions.
Rik <rik@octave.org>
parents:
12174
diff
changeset
|
16 { |
be41c30bcb44
Re-write documentation and all examples of dynamically linked functions.
Rik <rik@octave.org>
parents:
12174
diff
changeset
|
17 retval(i) = c(i); // using operator syntax |
be41c30bcb44
Re-write documentation and all examples of dynamically linked functions.
Rik <rik@octave.org>
parents:
12174
diff
changeset
|
18 //retval(i) = c.elem (i); // using method syntax |
be41c30bcb44
Re-write documentation and all examples of dynamically linked functions.
Rik <rik@octave.org>
parents:
12174
diff
changeset
|
19 } |
6572 | 20 } |
9053
4295d634797d
remove copyright notices from example files
John W. Eaton <jwe@octave.org>
parents:
7081
diff
changeset
|
21 |
6572 | 22 return retval; |
23 } |