Mercurial > octave
annotate scripts/plot/draw/quiver3.m @ 32074:03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
* scripts/plot/draw/private/__quiver__.m: Overhaul numeric input validation.
Simplify input classification using numeric input count switch statements
and avoid quiver3 miscount due to scale factor. Add error messages for all
valid numeric input combinations including vector x,y,z and scale factor.
Move newplot command from quiver/quiver3 into __quiver__ after numeric input
validation. Add hax as an output argument to return any changes back to
calling function.
* scripts/plot/draw/quiver.m: Remove newplot call. Update __quiver__ call
to include hax as a return variable. Update docstring with note that line
style and name-value pairs can both be provided but linstyle must appear
first. Add BISTs to check standard inputs with single and multiple arrows,
arrowhead shape, vector and array inputs, proper treatment of scaling factor
"off", some simple input styles, and input validation BISTs to cover all
numeric input errors. Added known failing BIST for linestyle+pair
arrowhead showing when it should stay off (bug #64143).
* scripts/plot/draw/quiver3.m: Remove newplot call. Update __quiver__ call
to include hax as a return variable. Update docstring with note that line
style and name-value pairs can both be provided but linstyle must appear
first. Add BISTs to check standard inputs with single and multiple arrows,
vector and array inputs, and input validation BISTs to cover all numeric
input errors.
* etc/NEWS.9.md: Update quiver/quiver3 improvement description under General
Improvements.
author | Nicholas R. Jankowski <jankowski.nicholas@gmail.com> |
---|---|
date | Wed, 03 May 2023 22:52:33 -0400 |
parents | ada96a467a28 |
children | 998cba4600e9 |
rev | line source |
---|---|
27923
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
1 ######################################################################## |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
2 ## |
31706
597f3ee61a48
update Octave Project Developers copyright for the new year
John W. Eaton <jwe@octave.org>
parents:
30564
diff
changeset
|
3 ## Copyright (C) 2007-2023 The Octave Project Developers |
27918
b442ec6dda5c
use centralized file for copyright info for individual contributors
John W. Eaton <jwe@octave.org>
parents:
26834
diff
changeset
|
4 ## |
27923
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
5 ## See the file COPYRIGHT.md in the top-level directory of this |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
6 ## distribution or <https://octave.org/copyright/>. |
7189 | 7 ## |
8 ## This file is part of Octave. | |
9 ## | |
24534
194eb4bd202b
maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents:
24432
diff
changeset
|
10 ## Octave is free software: you can redistribute it and/or modify it |
7189 | 11 ## under the terms of the GNU General Public License as published by |
24534
194eb4bd202b
maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents:
24432
diff
changeset
|
12 ## the Free Software Foundation, either version 3 of the License, or |
22755
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22367
diff
changeset
|
13 ## (at your option) any later version. |
7189 | 14 ## |
15 ## Octave is distributed in the hope that it will be useful, but | |
16 ## WITHOUT ANY WARRANTY; without even the implied warranty of | |
22755
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22367
diff
changeset
|
17 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22367
diff
changeset
|
18 ## GNU General Public License for more details. |
7189 | 19 ## |
20 ## You should have received a copy of the GNU General Public License | |
21 ## along with Octave; see the file COPYING. If not, see | |
24534
194eb4bd202b
maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents:
24432
diff
changeset
|
22 ## <https://www.gnu.org/licenses/>. |
27923
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
23 ## |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
24 ######################################################################## |
7189 | 25 |
26 ## -*- texinfo -*- | |
26834
e07ea25d58f5
quiver3.m: Fix texinfo typo in docstring from cset f7b10bd40045.
Rik <rik@octave.org>
parents:
26831
diff
changeset
|
27 ## @deftypefn {} {} quiver3 (@var{x}, @var{y}, @var{z}, @var{u}, @var{v}, @var{w}) |
e07ea25d58f5
quiver3.m: Fix texinfo typo in docstring from cset f7b10bd40045.
Rik <rik@octave.org>
parents:
26831
diff
changeset
|
28 ## @deftypefnx {} {} quiver3 (@var{z}, @var{u}, @var{v}, @var{w}) |
20852
516bb87ea72e
2015 Code Sprint: remove class of function from docstring for all m-files.
Rik <rik@octave.org>
parents:
20181
diff
changeset
|
29 ## @deftypefnx {} {} quiver3 (@dots{}, @var{s}) |
516bb87ea72e
2015 Code Sprint: remove class of function from docstring for all m-files.
Rik <rik@octave.org>
parents:
20181
diff
changeset
|
30 ## @deftypefnx {} {} quiver3 (@dots{}, @var{style}) |
516bb87ea72e
2015 Code Sprint: remove class of function from docstring for all m-files.
Rik <rik@octave.org>
parents:
20181
diff
changeset
|
31 ## @deftypefnx {} {} quiver3 (@dots{}, "filled") |
516bb87ea72e
2015 Code Sprint: remove class of function from docstring for all m-files.
Rik <rik@octave.org>
parents:
20181
diff
changeset
|
32 ## @deftypefnx {} {} quiver3 (@var{hax}, @dots{}) |
516bb87ea72e
2015 Code Sprint: remove class of function from docstring for all m-files.
Rik <rik@octave.org>
parents:
20181
diff
changeset
|
33 ## @deftypefnx {} {@var{h} =} quiver3 (@dots{}) |
7189 | 34 ## |
20173
777f26aa8e3e
doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents:
19697
diff
changeset
|
35 ## Plot a 3-D vector field with arrows. |
20181
aa36fb998a4d
maint: Remove unnecessary whitespace at end of lines.
Rik <rik@octave.org>
parents:
20173
diff
changeset
|
36 ## |
24381
6915cc404dba
doc: Clarify quiver/quiver3 documentation when a linestyle is given (bug #52608).
Rik <rik@octave.org>
parents:
23219
diff
changeset
|
37 ## Plot the (@var{u}, @var{v}, @var{w}) components of a vector field at the |
6915cc404dba
doc: Clarify quiver/quiver3 documentation when a linestyle is given (bug #52608).
Rik <rik@octave.org>
parents:
23219
diff
changeset
|
38 ## grid points defined by (@var{x}, @var{y}, @var{z}). If the grid is uniform |
32074
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
39 ## then @var{x}, @var{y}, and @var{z} can be specified as grid vectors and |
24381
6915cc404dba
doc: Clarify quiver/quiver3 documentation when a linestyle is given (bug #52608).
Rik <rik@octave.org>
parents:
23219
diff
changeset
|
40 ## @code{meshgrid} is used to create the 3-D grid. |
7189 | 41 ## |
26831
677764865056
Accept 4-input form for quiver3 (bug #55570).
Rik <rik@octave.org>
parents:
26376
diff
changeset
|
42 ## If @var{x} and @var{y} are not given they are assumed to be |
677764865056
Accept 4-input form for quiver3 (bug #55570).
Rik <rik@octave.org>
parents:
26376
diff
changeset
|
43 ## @code{(1:@var{m}, 1:@var{n})} where |
677764865056
Accept 4-input form for quiver3 (bug #55570).
Rik <rik@octave.org>
parents:
26376
diff
changeset
|
44 ## @code{[@var{m}, @var{n}] = size (@var{u})}. |
7189 | 45 ## |
24381
6915cc404dba
doc: Clarify quiver/quiver3 documentation when a linestyle is given (bug #52608).
Rik <rik@octave.org>
parents:
23219
diff
changeset
|
46 ## The optional input @var{s} is a scalar defining a scaling factor to use for |
6915cc404dba
doc: Clarify quiver/quiver3 documentation when a linestyle is given (bug #52608).
Rik <rik@octave.org>
parents:
23219
diff
changeset
|
47 ## the arrows of the field relative to the mesh spacing. A value of 1.0 will |
6915cc404dba
doc: Clarify quiver/quiver3 documentation when a linestyle is given (bug #52608).
Rik <rik@octave.org>
parents:
23219
diff
changeset
|
48 ## result in the longest vector exactly filling one grid cube. A value of 0 |
32062
ada96a467a28
quiver: Improve plotting with non-float numeric inputs (bug #59695)
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
31706
diff
changeset
|
49 ## or "off" disables all scaling. The default value is 0.9. |
7189 | 50 ## |
51 ## The style to use for the plot can be defined with a line style @var{style} | |
24381
6915cc404dba
doc: Clarify quiver/quiver3 documentation when a linestyle is given (bug #52608).
Rik <rik@octave.org>
parents:
23219
diff
changeset
|
52 ## of the same format as the @code{plot} command. If a marker is specified |
6915cc404dba
doc: Clarify quiver/quiver3 documentation when a linestyle is given (bug #52608).
Rik <rik@octave.org>
parents:
23219
diff
changeset
|
53 ## then the markers are drawn at the origin of the vectors (which are the grid |
6915cc404dba
doc: Clarify quiver/quiver3 documentation when a linestyle is given (bug #52608).
Rik <rik@octave.org>
parents:
23219
diff
changeset
|
54 ## points defined by @var{x}, @var{y}, @var{z}). When a marker is specified, |
6915cc404dba
doc: Clarify quiver/quiver3 documentation when a linestyle is given (bug #52608).
Rik <rik@octave.org>
parents:
23219
diff
changeset
|
55 ## the arrowhead is not drawn. If the argument @qcode{"filled"} is given then |
32074
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
56 ## the markers are filled. If name-value plot style properties are used, they |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
57 ## must appear in pairs and follow any other plot style arguments. |
7189 | 58 ## |
24431
0c6cedafc71e
doc: Use 'axes' rather than 'axis' appropriately in docstrings.
Rik <rik@octave.org>
parents:
24381
diff
changeset
|
59 ## If the first argument @var{hax} is an axes handle, then plot into this axes, |
17161
52931d71400f
doc: Document that first argument can be an axes handle for several plot functions.
Rik <rik@octave.org>
parents:
17122
diff
changeset
|
60 ## rather than the current axes returned by @code{gca}. |
52931d71400f
doc: Document that first argument can be an axes handle for several plot functions.
Rik <rik@octave.org>
parents:
17122
diff
changeset
|
61 ## |
14001
5f0bb45e615c
doc: Update documentation for functions returning a graphics handle h (Bug #34761)
Rik <octave@nomad.inbox5.com>
parents:
11587
diff
changeset
|
62 ## The optional return value @var{h} is a graphics handle to a quiver object. |
5f0bb45e615c
doc: Update documentation for functions returning a graphics handle h (Bug #34761)
Rik <octave@nomad.inbox5.com>
parents:
11587
diff
changeset
|
63 ## A quiver object regroups the components of the quiver plot (body, arrow, |
5f0bb45e615c
doc: Update documentation for functions returning a graphics handle h (Bug #34761)
Rik <octave@nomad.inbox5.com>
parents:
11587
diff
changeset
|
64 ## and marker), and allows them to be changed together. |
7189 | 65 ## |
66 ## @example | |
67 ## @group | |
68 ## [x, y, z] = peaks (25); | |
69 ## surf (x, y, z); | |
70 ## hold on; | |
71 ## [u, v, w] = surfnorm (x, y, z / 10); | |
8056
9a6f4713f765
Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents:
7245
diff
changeset
|
72 ## h = quiver3 (x, y, z, u, v, w); |
9a6f4713f765
Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents:
7245
diff
changeset
|
73 ## set (h, "maxheadsize", 0.33); |
7189 | 74 ## @end group |
75 ## @end example | |
76 ## | |
17122
eaab03308c0b
doc: Rewrite docstrings for most plot functions.
Rik <rik@octave.org>
parents:
17070
diff
changeset
|
77 ## @seealso{quiver, compass, feather, plot} |
7189 | 78 ## @end deftypefn |
79 | |
17671 | 80 function h = quiver3 (varargin) |
7189 | 81 |
17070
d465f9970c02
quiver.m, quiver3.m: Upgrade to use new __plt_get_axis_arg__.
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
16814
diff
changeset
|
82 [hax, varargin, nargin] = __plt_get_axis_arg__ ("quiver3", varargin{:}); |
7215 | 83 |
32062
ada96a467a28
quiver: Improve plotting with non-float numeric inputs (bug #59695)
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
31706
diff
changeset
|
84 if (nargin < 4) |
7189 | 85 print_usage (); |
17671 | 86 endif |
87 | |
17211
87ba70043bfc
Don't use ifelse in plot fcns to avoid unnecessary fcn evaluations.
Rik <rik@octave.org>
parents:
17161
diff
changeset
|
88 oldfig = []; |
17301
68bcac3c043a
Correct inversion accidentally introduced in cset 87ba70043bfc.
Rik <rik@octave.org>
parents:
17281
diff
changeset
|
89 if (! isempty (hax)) |
17211
87ba70043bfc
Don't use ifelse in plot fcns to avoid unnecessary fcn evaluations.
Rik <rik@octave.org>
parents:
17161
diff
changeset
|
90 oldfig = get (0, "currentfigure"); |
87ba70043bfc
Don't use ifelse in plot fcns to avoid unnecessary fcn evaluations.
Rik <rik@octave.org>
parents:
17161
diff
changeset
|
91 endif |
17671 | 92 unwind_protect |
32074
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
93 [hax, htmp] = __quiver__ (hax, true, varargin{:}); |
17070
d465f9970c02
quiver.m, quiver3.m: Upgrade to use new __plt_get_axis_arg__.
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
16814
diff
changeset
|
94 |
22367
459545bc9019
Use ishold () rather than ishold (hax) for performance.
Rik <rik@octave.org>
parents:
22351
diff
changeset
|
95 if (! ishold ()) |
22351
e6df1ddfc3cf
Change DefaultAxesBox property to "off".
Rik <rik@octave.org>
parents:
22323
diff
changeset
|
96 set (hax, "view", [-37.5, 30], |
17671 | 97 "xgrid", "on", "ygrid", "on", "zgrid", "on"); |
98 endif | |
99 unwind_protect_cleanup | |
100 if (! isempty (oldfig)) | |
101 set (0, "currentfigure", oldfig); | |
102 endif | |
103 end_unwind_protect | |
7189 | 104 |
105 if (nargout > 0) | |
17671 | 106 h = htmp; |
7189 | 107 endif |
108 | |
109 endfunction | |
110 | |
111 %!demo | |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
112 %! clf; |
22302
1c4cd12987f5
Use Octave syntax in graphics demos.
Rik <rik@octave.org>
parents:
21546
diff
changeset
|
113 %! colormap ("default"); |
7245 | 114 %! [x, y, z] = peaks (25); |
115 %! surf (x, y, z); | |
116 %! hold on; | |
117 %! [u, v, w] = surfnorm (x, y, z / 10); | |
8056
9a6f4713f765
Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents:
7245
diff
changeset
|
118 %! h = quiver3 (x, y, z, u, v, w); |
22302
1c4cd12987f5
Use Octave syntax in graphics demos.
Rik <rik@octave.org>
parents:
21546
diff
changeset
|
119 %! set (h, "maxheadsize", 0.25); |
8253
873ea2c72f16
quiver3.m: turn hold off after demo
John W. Eaton <jwe@octave.org>
parents:
8056
diff
changeset
|
120 %! hold off; |
24381
6915cc404dba
doc: Clarify quiver/quiver3 documentation when a linestyle is given (bug #52608).
Rik <rik@octave.org>
parents:
23219
diff
changeset
|
121 %! title ("quiver3() of surface normals to peaks() function"); |
8889
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8253
diff
changeset
|
122 |
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8253
diff
changeset
|
123 %!demo |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
124 %! clf; |
22302
1c4cd12987f5
Use Octave syntax in graphics demos.
Rik <rik@octave.org>
parents:
21546
diff
changeset
|
125 %! colormap ("default"); |
14092
22c50cbad2ce
Add clf() to all plot demos.
Ben Abbott <bpabbott@mac.com>
parents:
14001
diff
changeset
|
126 %! [x, y, z] = peaks (25); |
22c50cbad2ce
Add clf() to all plot demos.
Ben Abbott <bpabbott@mac.com>
parents:
14001
diff
changeset
|
127 %! surf (x, y, z); |
22c50cbad2ce
Add clf() to all plot demos.
Ben Abbott <bpabbott@mac.com>
parents:
14001
diff
changeset
|
128 %! hold on; |
22c50cbad2ce
Add clf() to all plot demos.
Ben Abbott <bpabbott@mac.com>
parents:
14001
diff
changeset
|
129 %! [u, v, w] = surfnorm (x, y, z / 10); |
22c50cbad2ce
Add clf() to all plot demos.
Ben Abbott <bpabbott@mac.com>
parents:
14001
diff
changeset
|
130 %! h = quiver3 (x, y, z, u, v, w); |
22302
1c4cd12987f5
Use Octave syntax in graphics demos.
Rik <rik@octave.org>
parents:
21546
diff
changeset
|
131 %! set (h, "maxheadsize", 0.25); |
14092
22c50cbad2ce
Add clf() to all plot demos.
Ben Abbott <bpabbott@mac.com>
parents:
14001
diff
changeset
|
132 %! hold off; |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
133 %! shading interp; |
24381
6915cc404dba
doc: Clarify quiver/quiver3 documentation when a linestyle is given (bug #52608).
Rik <rik@octave.org>
parents:
23219
diff
changeset
|
134 %! title ({"quiver3() of surface normals to peaks() function"; ... |
17671 | 135 %! 'shading "interp"'}); |
32062
ada96a467a28
quiver: Improve plotting with non-float numeric inputs (bug #59695)
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
31706
diff
changeset
|
136 |
32074
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
137 ## Check standard inputs, single arrow. |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
138 %!test |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
139 %! hf = figure ("visible", "off"); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
140 %! hax = gca (); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
141 %! unwind_protect |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
142 %! |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
143 %! h = quiver3 (hax, 0, 1, 2, 3); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
144 %! children = get (h, "children"); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
145 %! childxdata = get (children, "xdata"); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
146 %! childydata = get (children, "ydata"); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
147 %! childzdata = get (children, "zdata"); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
148 %! stemchild = find (cellfun (@numel, childxdata) == 3); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
149 %! arrowheadchild = find (cellfun (@numel, childxdata) == 4); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
150 %! assert (childxdata{stemchild}(1), 1, eps); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
151 %! assert (childxdata{stemchild}(2), 1 + 1*0.9, eps); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
152 %! assert (isnan (childxdata{stemchild}(3))); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
153 %! assert (childxdata{arrowheadchild}(2), 1 + 1*0.9, eps); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
154 %! assert (isnan (childxdata{arrowheadchild}(4))); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
155 %! assert (childydata{stemchild}(1), 1, eps); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
156 %! assert (childydata{stemchild}(2), 1 + 2*0.9, eps); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
157 %! assert (isnan (childydata{stemchild}(3))); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
158 %! assert (childydata{arrowheadchild}(2), 1 + 2*0.9, eps); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
159 %! assert (isnan (childydata{arrowheadchild}(4))); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
160 %! assert (childzdata{stemchild}(1), 0, eps); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
161 %! assert (childzdata{stemchild}(2), 0 + 3*0.9, eps); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
162 %! assert (isnan (childzdata{stemchild}(3))); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
163 %! assert (childzdata{arrowheadchild}(2), 0 + 3*0.9, eps); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
164 %! assert (isnan (childzdata{arrowheadchild}(4))); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
165 %! |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
166 %! h = quiver3 (hax, 1, 1, 0, 1, 2, 3); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
167 %! children = get (h, "children"); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
168 %! childxdata = get (children, "xdata"); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
169 %! childydata = get (children, "ydata"); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
170 %! childzdata = get (children, "zdata"); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
171 %! stemchild = find (cellfun (@numel, childxdata) == 3); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
172 %! arrowheadchild = find (cellfun (@numel, childxdata) == 4); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
173 %! assert (childxdata{stemchild}(1), 1, eps); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
174 %! assert (childxdata{stemchild}(2), 1 + 1*0.9, eps); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
175 %! assert (isnan (childxdata{stemchild}(3))); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
176 %! assert (childxdata{arrowheadchild}(2), 1 + 1*0.9, eps); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
177 %! assert (isnan (childxdata{arrowheadchild}(4))); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
178 %! assert (childydata{stemchild}(1), 1, eps); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
179 %! assert (childydata{stemchild}(2), 1 + 2*0.9, eps); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
180 %! assert (isnan (childydata{stemchild}(3))); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
181 %! assert (childydata{arrowheadchild}(2), 1 + 2*0.9, eps); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
182 %! assert (isnan (childydata{arrowheadchild}(4))); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
183 %! assert (childzdata{stemchild}(1), 0, eps); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
184 %! assert (childzdata{stemchild}(2), 0 + 3*0.9, eps); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
185 %! assert (isnan (childzdata{stemchild}(3))); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
186 %! assert (childzdata{arrowheadchild}(2), 0 + 3*0.9, eps); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
187 %! assert (isnan (childzdata{arrowheadchild}(4))); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
188 %! unwind_protect_cleanup |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
189 %! close (hf); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
190 %! end_unwind_protect |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
191 |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
192 ## Check standard inputs, multiple arrows. |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
193 %!test |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
194 %! hf = figure ("visible", "off"); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
195 %! hax = gca (); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
196 %! unwind_protect |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
197 %! |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
198 %! a = reshape(1:12,2,3,2); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
199 %! x = 1:3; y = 1:2; z = 1:2; |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
200 %! [xx,yy,zz] = meshgrid (x,y,z); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
201 %! numpts = 12; |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
202 %! sf= sqrt(sumsq([1/3 1/2 11/6])/432); # Actual internal scale factor, z=a. |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
203 %! sf2= sqrt(sumsq([1/3 1/2 1/6])/432); # z vector internal scale factor. |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
204 %! |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
205 %! h = quiver3 (hax, a, a, a, a, 1); # No x,y input. |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
206 %! children = get (h, "children"); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
207 %! childxdata = get (children, "xdata"); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
208 %! childydata = get (children, "ydata"); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
209 %! childzdata = get (children, "zdata"); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
210 %! basechild = find (cellfun (@numel, childxdata) == numpts); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
211 %! stemchild = find (cellfun (@numel, childxdata) == numpts*3); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
212 %! arrowheadchild = find (cellfun (@numel, childxdata) == numpts*4); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
213 %! ## Check all bases. |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
214 %! assert (childxdata{basechild}, [1, 1, 2, 2, 3, 3, 1, 1, 2, 2, 3, 3]); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
215 %! assert (childydata{basechild}, [1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2]); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
216 %! assert (childzdata{basechild}, [1:12]); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
217 %! ## Check first arrow. |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
218 %! assert (childxdata{stemchild}(1), 1, eps); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
219 %! assert (childxdata{stemchild}(2), 1 + 1*sf, eps); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
220 %! assert (isnan (childxdata{stemchild}(3))); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
221 %! assert (childxdata{arrowheadchild}(2), 1 + 1*sf, eps); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
222 %! assert (isnan (childxdata{arrowheadchild}(4))); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
223 %! assert (childydata{stemchild}(1), 1, eps); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
224 %! assert (childydata{stemchild}(2), 1 + 1*sf, eps); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
225 %! assert (isnan (childydata{stemchild}(3))); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
226 %! assert (childydata{arrowheadchild}(2), 1 + 1*sf, eps); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
227 %! assert (isnan (childydata{arrowheadchild}(4))); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
228 %! assert (childzdata{stemchild}(1), 1, eps); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
229 %! assert (childzdata{stemchild}(2), 1 + 1*sf, eps); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
230 %! assert (isnan (childzdata{stemchild}(3))); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
231 %! assert (childzdata{arrowheadchild}(2), 1 + 1*sf, eps); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
232 %! assert (isnan (childzdata{arrowheadchild}(4))); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
233 %! ## Check last arrow. |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
234 %! assert (childxdata{stemchild}(numpts*3-2), 3, eps); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
235 %! assert (childxdata{stemchild}(numpts*3-1), 3 + 12*sf, eps); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
236 %! assert (isnan (childxdata{stemchild}(end))); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
237 %! assert (childxdata{arrowheadchild}(numpts*4-2), 3 + 12*sf, eps); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
238 %! assert (isnan (childxdata{arrowheadchild}(end))); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
239 %! assert (childydata{stemchild}(numpts*3-2), 2, eps); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
240 %! assert (childydata{stemchild}(numpts*3-1), 2 + 12*sf, eps); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
241 %! assert (isnan (childydata{stemchild}(end))); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
242 %! assert (childydata{arrowheadchild}(numpts*4-2), 2 + 12*sf, eps); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
243 %! assert (isnan (childydata{arrowheadchild}(end))); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
244 %! assert (childzdata{stemchild}(numpts*3-2), 12, eps); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
245 %! assert (childzdata{stemchild}(numpts*3-1), 12 + 12*sf, eps); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
246 %! assert (isnan (childzdata{stemchild}(end))); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
247 %! assert (childzdata{arrowheadchild}(numpts*4-2), 12 + 12*sf, eps); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
248 %! assert (isnan (childzdata{arrowheadchild}(end))); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
249 %! |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
250 %! h = quiver3 (hax, xx, yy, a, a, a, a, 1); # x,y input as matrices. |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
251 %! children = get (h, "children"); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
252 %! childxdata = get (children, "xdata"); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
253 %! childydata = get (children, "ydata"); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
254 %! childzdata = get (children, "zdata"); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
255 %! basechild = find (cellfun (@numel, childxdata) == numpts); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
256 %! stemchild = find (cellfun (@numel, childxdata) == numpts*3); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
257 %! arrowheadchild = find (cellfun (@numel, childxdata) == numpts*4); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
258 %! ## Check all bases. |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
259 %! assert (childxdata{basechild}, [1, 1, 2, 2, 3, 3, 1, 1, 2, 2, 3, 3]); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
260 %! assert (childydata{basechild}, [1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2]); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
261 %! assert (childzdata{basechild}, [1:12]); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
262 %! ## Check first arrow. |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
263 %! assert (childxdata{stemchild}(1), 1, eps); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
264 %! assert (childxdata{stemchild}(2), 1 + 1*sf, eps); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
265 %! assert (isnan (childxdata{stemchild}(3))); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
266 %! assert (childxdata{arrowheadchild}(2), 1 + 1*sf, eps); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
267 %! assert (isnan (childxdata{arrowheadchild}(4))); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
268 %! assert (childydata{stemchild}(1), 1, eps); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
269 %! assert (childydata{stemchild}(2), 1 + 1*sf, eps); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
270 %! assert (isnan (childydata{stemchild}(3))); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
271 %! assert (childydata{arrowheadchild}(2), 1 + 1*sf, eps); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
272 %! assert (isnan (childydata{arrowheadchild}(4))); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
273 %! assert (childzdata{stemchild}(1), 1, eps); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
274 %! assert (childzdata{stemchild}(2), 1 + 1*sf, eps); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
275 %! assert (isnan (childzdata{stemchild}(3))); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
276 %! assert (childzdata{arrowheadchild}(2), 1 + 1*sf, eps); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
277 %! assert (isnan (childzdata{arrowheadchild}(4))); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
278 %! ## Check last arrow. |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
279 %! assert (childxdata{stemchild}(numpts*3-2), 3, eps); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
280 %! assert (childxdata{stemchild}(numpts*3-1), 3 + 12*sf, eps); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
281 %! assert (isnan (childxdata{stemchild}(end))); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
282 %! assert (childxdata{arrowheadchild}(numpts*4-2), 3 + 12*sf, eps); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
283 %! assert (isnan (childxdata{arrowheadchild}(end))); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
284 %! assert (childydata{stemchild}(numpts*3-2), 2, eps); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
285 %! assert (childydata{stemchild}(numpts*3-1), 2 + 12*sf, eps); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
286 %! assert (isnan (childydata{stemchild}(end))); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
287 %! assert (childydata{arrowheadchild}(numpts*4-2), 2 + 12*sf, eps); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
288 %! assert (isnan (childydata{arrowheadchild}(end))); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
289 %! assert (childzdata{stemchild}(numpts*3-2), 12, eps); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
290 %! assert (childzdata{stemchild}(numpts*3-1), 12 + 12*sf, eps); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
291 %! assert (isnan (childzdata{stemchild}(end))); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
292 %! assert (childzdata{arrowheadchild}(numpts*4-2), 12 + 12*sf, eps); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
293 %! assert (isnan (childzdata{arrowheadchild}(end))); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
294 %! |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
295 %! h = quiver3 (hax, x, y, z, a, a, a, 1); # x,y z input as vectors. |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
296 %! children = get (h, "children"); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
297 %! childxdata = get (children, "xdata"); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
298 %! childydata = get (children, "ydata"); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
299 %! childzdata = get (children, "zdata"); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
300 %! basechild = find (cellfun (@numel, childxdata) == numpts); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
301 %! stemchild = find (cellfun (@numel, childxdata) == numpts*3); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
302 %! arrowheadchild = find (cellfun (@numel, childxdata) == numpts*4); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
303 %! ## Check all bases. |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
304 %! assert (childxdata{basechild}, [1, 1, 2, 2, 3, 3, 1, 1, 2, 2, 3, 3]); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
305 %! assert (childydata{basechild}, [1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2]); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
306 %! assert (childzdata{basechild}, [1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2]); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
307 %! ## Check first arrow. |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
308 %! assert (childxdata{stemchild}(1), 1, eps); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
309 %! assert (childxdata{stemchild}(2), 1 + 1*sf2, eps); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
310 %! assert (isnan (childxdata{stemchild}(3))); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
311 %! assert (childxdata{arrowheadchild}(2), 1 + 1*sf2, eps); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
312 %! assert (isnan (childxdata{arrowheadchild}(4))); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
313 %! assert (childydata{stemchild}(1), 1, eps); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
314 %! assert (childydata{stemchild}(2), 1 + 1*sf2, eps); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
315 %! assert (isnan (childydata{stemchild}(3))); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
316 %! assert (childydata{arrowheadchild}(2), 1 + 1*sf2, eps); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
317 %! assert (isnan (childydata{arrowheadchild}(4))); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
318 %! assert (childzdata{stemchild}(1), 1, eps); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
319 %! assert (childzdata{stemchild}(2), 1 + 1*sf2, eps); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
320 %! assert (isnan (childzdata{stemchild}(3))); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
321 %! assert (childzdata{arrowheadchild}(2), 1 + 1*sf2, eps); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
322 %! assert (isnan (childzdata{arrowheadchild}(4))); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
323 %! ## Check last arrow. |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
324 %! assert (childxdata{stemchild}(numpts*3-2), 3, eps); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
325 %! assert (childxdata{stemchild}(numpts*3-1), 3 + 12*sf2, eps); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
326 %! assert (isnan (childxdata{stemchild}(end))); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
327 %! assert (childxdata{arrowheadchild}(numpts*4-2), 3 + 12*sf2, eps); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
328 %! assert (isnan (childxdata{arrowheadchild}(end))); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
329 %! assert (childydata{stemchild}(numpts*3-2), 2, eps); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
330 %! assert (childydata{stemchild}(numpts*3-1), 2 + 12*sf2, eps); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
331 %! assert (isnan (childydata{stemchild}(end))); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
332 %! assert (childydata{arrowheadchild}(numpts*4-2), 2 + 12*sf2, eps); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
333 %! assert (isnan (childydata{arrowheadchild}(end))); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
334 %! assert (childzdata{stemchild}(numpts*3-2), 2, eps); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
335 %! assert (childzdata{stemchild}(numpts*3-1), 2 + 12*sf2, eps); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
336 %! assert (isnan (childzdata{stemchild}(end))); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
337 %! assert (childzdata{arrowheadchild}(numpts*4-2), 2 + 12*sf2, eps); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
338 %! assert (isnan (childzdata{arrowheadchild}(end))); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
339 %! unwind_protect_cleanup |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
340 %! close (hf); |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
341 %! end_unwind_protect |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
342 |
32062
ada96a467a28
quiver: Improve plotting with non-float numeric inputs (bug #59695)
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
31706
diff
changeset
|
343 ##Test input validation |
ada96a467a28
quiver: Improve plotting with non-float numeric inputs (bug #59695)
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
31706
diff
changeset
|
344 %!error <Invalid call> quiver3 () |
ada96a467a28
quiver: Improve plotting with non-float numeric inputs (bug #59695)
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
31706
diff
changeset
|
345 %!error <Invalid call> quiver3 (1.1) |
ada96a467a28
quiver: Improve plotting with non-float numeric inputs (bug #59695)
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
31706
diff
changeset
|
346 %!error <Invalid call> quiver3 (1.1, 2) |
ada96a467a28
quiver: Improve plotting with non-float numeric inputs (bug #59695)
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
31706
diff
changeset
|
347 %!error <Invalid call> quiver3 (1.1, 2, 3) |
32074
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
348 %!error <Invalid call> quiver3 (1.1, 2, 3, "foo") |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
349 %!error <Invalid call> quiver3 (1.1, 2, 3, 4, 5, 6, 7, 8, "foo") |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
350 %!error <U, V, and W must be the same> quiver3 (30, [40 50], 60, 70) |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
351 %!error <Z vector length must equal size of> quiver3 ([30 40], eye(3), eye(3), eye(3)) |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
352 %!error <Z, U, V, and W must be the same> quiver3 ([30 40], 50, 60, 70) |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
353 %!error <Z, U, V, and W must be the same> quiver3 (eye(2), eye(3), eye(2), eye(2)) |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
354 %!error <Z, U, V, and W must be the same> quiver3 (eye(2), eye(2), eye(3), eye(2)) |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
355 %!error <Z, U, V, and W must be the same> quiver3 (eye(2), eye(2), eye(2), eye(3)) |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
356 %!error <U, V, and W must be the same size> quiver3 ([1:2], [1:2], 1, eye(3), eye(2), eye(2)) |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
357 %!error <U, V, and W must be the same size> quiver3 ([1:2], [1:2], 1, eye(2), eye(3), eye(2)) |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
358 %!error <U, V, and W must be the same size> quiver3 ([1:2], [1:2], 1, eye(2), eye(2), eye(3)) |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
359 %!error <X vector length must equal number of> quiver3 ([1:3], [1:2], 1, eye(2), eye(2), eye(2)) |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
360 %!error <Y vector length must equal number of> quiver3 ([1:2], [1:3], 1, eye(2), eye(2), eye(2)) |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
361 %!error <Z vector length must equal size of> quiver3 ([1:2], [1:2], [1:2], eye(2), eye(2), eye(2)) |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
362 %!error <X, Y, Z, U, V, and W must be the same size> quiver3 (eye(3), eye(2), eye(2), eye(2), eye(2), eye(2)) |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
363 %!error <X, Y, Z, U, V, and W must be the same size> quiver3 (eye(2), eye(3), eye(2), eye(2), eye(2), eye(2)) |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
364 %!error <X, Y, Z, U, V, and W must be the same size> quiver3 (eye(2), eye(2), eye(3), eye(2), eye(2), eye(2)) |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
365 %!error <X, Y, Z, U, V, and W must be the same size> quiver3 (eye(2), eye(2), eye(2), eye(3), eye(2), eye(2)) |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
366 %!error <X, Y, Z, U, V, and W must be the same size> quiver3 (eye(2), eye(2), eye(2), eye(2), eye(3), eye(2)) |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
367 %!error <X, Y, Z, U, V, and W must be the same size> quiver3 (eye(2), eye(2), eye(2), eye(2), eye(2), eye(3)) |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
368 %!error <scaling factor must be> quiver3 (10, 20, 30, 40, -5) |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
369 %!error <scaling factor must be> quiver3 (10, 20, 30, 40, [1 2]) |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
370 %!error <scaling factor must be> quiver3 (10, 20, 30, 40, 50, 60, -5) |
03fe0b635d2e
quiver/quiver3: Overhaul input processing, validation, and add BISTs.
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32062
diff
changeset
|
371 %!error <scaling factor must be> quiver3 (10, 20, 30, 40, 50, 60, [1 2]) |