Mercurial > octave
annotate scripts/optimization/pqpnonneg.m @ 28789:28de41192f3c
Eliminate unneeded verification of nargin, nargout in m-files.
* FIRfilter.m, FIRfilter_aggregation.m, get.m, polynomial.m,
polynomial_superiorto.m, polynomial2.m, makeUniqueStrings.m, base64decode.m,
base64encode.m, cd.m, lin2mu.m, record.m, sound.m, soundsc.m, accumarray.m,
accumdim.m, bitcmp.m, bitset.m, cart2pol.m, celldisp.m, circshift.m,
cplxpair.m, cumtrapz.m, flip.m, idivide.m, interpft.m, logspace.m, pol2cart.m,
polyarea.m, postpad.m, prepad.m, rat.m, rot90.m, rotdim.m, shift.m, shiftdim.m,
sortrows.m, trapz.m, dsearch.m, dsearchn.m, getappdata.m, getpixelposition.m,
guidata.m, guihandles.m, isappdata.m, listfonts.m, uigetdir.m,
waitforbuttonpress.m, __makeinfo__.m, doc.m, get_first_help_sentence.m,
autumn.m, bone.m, brighten.m, cmpermute.m, cmunique.m, colorcube.m, contrast.m,
cool.m, copper.m, cubehelix.m, flag.m, gray.m, gray2ind.m, hot.m, hsv.m,
im2double.m, im2frame.m, imformats.m, jet.m, lines.m, ocean.m, pink.m, prism.m,
rainbow.m, rgbplot.m, spinmap.m, spring.m, summer.m, viridis.m, white.m,
winter.m, beep.m, importdata.m, is_valid_file_id.m, javachk.m, javaclasspath.m,
findstr.m, genvarname.m, strmatch.m, bandwidth.m, commutation_matrix.m, cond.m,
cross.m, isdefinite.m, ishermitian.m, issymmetric.m, krylov.m, linsolve.m,
logm.m, lscov.m, null.m, ordeig.m, orth.m, rank.m, rref.m, vecnorm.m,
bunzip2.m, citation.m, computer.m, copyfile.m, dir.m, dos.m, fileattrib.m,
gunzip.m, inputParser.m, inputname.m, ismac.m, ispc.m, isunix.m, license.m,
list_primes.m, methods.m, mkdir.m, movefile.m, nargchk.m, news.m,
orderfields.m, recycle.m, tar.m, unix.m, unpack.m, untar.m, unzip.m, ver.m,
version.m, what.m, zip.m, decic.m, fminbnd.m, fminunc.m, fsolve.m, fzero.m,
glpk.m, humps.m, lsqnonneg.m, optimget.m, pqpnonneg.m, sqp.m, pathdef.m,
camlookat.m, hidden.m, specular.m, plotmatrix.m, smooth3.m, sombrero.m,
stemleaf.m, __gnuplot_drawnow__.m, __opengl_info__.m, ancestor.m, cla.m,
close.m, closereq.m, copyobj.m, gca.m, gcf.m, ginput.m, graphics_toolkit.m,
groot.m, hgload.m, hgsave.m, isgraphics.m, ishold.m, linkaxes.m, meshgrid.m,
newplot.m, refresh.m, refreshdata.m, rotate.m, saveas.m, struct2hdl.m, conv.m,
mkpp.m, mpoles.m, padecoef.m, pchip.m, polyder.m, polyfit.m, polygcd.m,
polyint.m, polyout.m, polyval.m, ppder.m, ppint.m, getpref.m, ispref.m,
rmpref.m, profexport.m, profshow.m, powerset.m, arch_fit.m, arma_rnd.m,
blackman.m, detrend.m, diffpara.m, fftconv.m, fftfilt.m, filter2.m, freqz.m,
freqz_plot.m, hamming.m, hanning.m, sinetone.m, sinewave.m, spectral_adf.m,
spectral_xdf.m, stft.m, unwrap.m, gplot.m, ichol.m, ilu.m, spdiags.m, sprand.m,
sprandn.m, spstats.m, svds.m, treelayout.m, treeplot.m, betainc.m,
betaincinv.m, ellipke.m, gammainc.m, gammaincinv.m, legendre.m, pow2.m,
hankel.m, pascal.m, rosser.m, toeplitz.m, bounds.m, corr.m, cov.m, histc.m,
kendall.m, kurtosis.m, mad.m, mode.m, moment.m, prctile.m, quantile.m, range.m,
ranks.m, run_count.m, skewness.m, spearman.m, std.m, var.m, zscore.m,
dec2base.m, dec2bin.m, dec2hex.m, index.m, mat2str.m, native2unicode.m,
ostrsplit.m, strjoin.m, strjust.m, strtok.m, substr.m, unicode2native.m,
untabify.m, __debug_octave__.m, demo.m, example.m, fail.m, oruntests.m,
dump_demos.m, speed.m, test.m, date.m, datenum.m, datestr.m, datevec.m,
is_leap_year.m, now.m, weekday.m:
Eliminate unneeded verification of nargin, nargout in m-files now that
the interpreter checks these values.
author | Rik <rik@octave.org> |
---|---|
date | Thu, 24 Sep 2020 14:44:58 -0700 |
parents | bd51beb6205e |
children | 90fea9cc9caa |
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 ## |
27919
1891570abac8
update Octave Project Developers copyright for the new year
John W. Eaton <jwe@octave.org>
parents:
27918
diff
changeset
|
3 ## Copyright (C) 2008-2020 The Octave Project Developers |
27918
b442ec6dda5c
use centralized file for copyright info for individual contributors
John W. Eaton <jwe@octave.org>
parents:
26376
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/>. |
9635 | 7 ## |
8 ## This file is part of Octave. | |
9 ## | |
24534
194eb4bd202b
maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents:
23220
diff
changeset
|
10 ## Octave is free software: you can redistribute it and/or modify it |
9635 | 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:
23220
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:
22323
diff
changeset
|
13 ## (at your option) any later version. |
9635 | 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:
22323
diff
changeset
|
17 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22323
diff
changeset
|
18 ## GNU General Public License for more details. |
9635 | 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:
23220
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 ######################################################################## |
9635 | 25 |
26 ## -*- texinfo -*- | |
20852
516bb87ea72e
2015 Code Sprint: remove class of function from docstring for all m-files.
Rik <rik@octave.org>
parents:
20735
diff
changeset
|
27 ## @deftypefn {} {@var{x} =} pqpnonneg (@var{c}, @var{d}) |
516bb87ea72e
2015 Code Sprint: remove class of function from docstring for all m-files.
Rik <rik@octave.org>
parents:
20735
diff
changeset
|
28 ## @deftypefnx {} {@var{x} =} pqpnonneg (@var{c}, @var{d}, @var{x0}) |
22760
c4d80b9d2898
maint: Capitalize variable names appearing in error() messages of m-files.
Rik <rik@octave.org>
parents:
22755
diff
changeset
|
29 ## @deftypefnx {} {@var{x} =} pqpnonneg (@var{c}, @var{d}, @var{x0}, @var{options}) |
20852
516bb87ea72e
2015 Code Sprint: remove class of function from docstring for all m-files.
Rik <rik@octave.org>
parents:
20735
diff
changeset
|
30 ## @deftypefnx {} {[@var{x}, @var{minval}] =} pqpnonneg (@dots{}) |
516bb87ea72e
2015 Code Sprint: remove class of function from docstring for all m-files.
Rik <rik@octave.org>
parents:
20735
diff
changeset
|
31 ## @deftypefnx {} {[@var{x}, @var{minval}, @var{exitflag}] =} pqpnonneg (@dots{}) |
516bb87ea72e
2015 Code Sprint: remove class of function from docstring for all m-files.
Rik <rik@octave.org>
parents:
20735
diff
changeset
|
32 ## @deftypefnx {} {[@var{x}, @var{minval}, @var{exitflag}, @var{output}] =} pqpnonneg (@dots{}) |
516bb87ea72e
2015 Code Sprint: remove class of function from docstring for all m-files.
Rik <rik@octave.org>
parents:
20735
diff
changeset
|
33 ## @deftypefnx {} {[@var{x}, @var{minval}, @var{exitflag}, @var{output}, @var{lambda}] =} pqpnonneg (@dots{}) |
20165
f1d0f506ee78
doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents:
19833
diff
changeset
|
34 ## |
22764 | 35 ## Minimize @code{1/2*@var{x}'*@var{c}*@var{x} + @var{d}'*@var{x}} subject to |
36 ## @code{@var{x} >= 0}. | |
20165
f1d0f506ee78
doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents:
19833
diff
changeset
|
37 ## |
22764 | 38 ## @var{c} and @var{d} must be real matrices, and @var{c} must be symmetric and |
20165
f1d0f506ee78
doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents:
19833
diff
changeset
|
39 ## positive definite. |
f1d0f506ee78
doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents:
19833
diff
changeset
|
40 ## |
22764 | 41 ## @var{x0} is an optional initial guess for the solution @var{x}. |
9635 | 42 ## |
22760
c4d80b9d2898
maint: Capitalize variable names appearing in error() messages of m-files.
Rik <rik@octave.org>
parents:
22755
diff
changeset
|
43 ## @var{options} is an options structure to change the behavior of the |
25579
07c2c42f457e
doc: Miscellaneous documentation fixes all over the manual (bug #54288).
Rik <rik@octave.org>
parents:
25054
diff
changeset
|
44 ## algorithm (@pxref{XREFoptimset,,optimset}). @code{pqpnonneg} recognizes |
22769 | 45 ## one option: @qcode{"MaxIter"}. |
9635 | 46 ## |
47 ## Outputs: | |
14366
b76f0740940e
doc: Periodic grammar check of documentation.
Rik <octave@nomad.inbox5.com>
parents:
14363
diff
changeset
|
48 ## |
22764 | 49 ## @table @var |
50 ## | |
51 ## @item x | |
52 ## The solution matrix | |
53 ## | |
9635 | 54 ## @item minval |
22764 | 55 ## The minimum attained model value, |
56 ## @code{1/2*@var{xmin}'*@var{c}*@var{xmin} + @var{d}'*@var{xmin}} | |
10821
693e22af08ae
Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents:
10793
diff
changeset
|
57 ## |
9635 | 58 ## @item exitflag |
20165
f1d0f506ee78
doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents:
19833
diff
changeset
|
59 ## An indicator of convergence. 0 indicates that the iteration count was |
f1d0f506ee78
doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents:
19833
diff
changeset
|
60 ## exceeded, and therefore convergence was not reached; >0 indicates that the |
f1d0f506ee78
doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents:
19833
diff
changeset
|
61 ## algorithm converged. (The algorithm is stable and will converge given |
f1d0f506ee78
doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents:
19833
diff
changeset
|
62 ## enough iterations.) |
10821
693e22af08ae
Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents:
10793
diff
changeset
|
63 ## |
9635 | 64 ## @item output |
65 ## A structure with two fields: | |
14366
b76f0740940e
doc: Periodic grammar check of documentation.
Rik <octave@nomad.inbox5.com>
parents:
14363
diff
changeset
|
66 ## |
9635 | 67 ## @itemize @bullet |
25003
2365c2661b3c
doc: Spellcheck documentation ahead of 4.4 release.
Rik <rik@octave.org>
parents:
24534
diff
changeset
|
68 ## @item @qcode{"algorithm"}: The algorithm used (@nospell{@qcode{"nnls"}}) |
10821
693e22af08ae
Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents:
10793
diff
changeset
|
69 ## |
17281
bc924baa2c4e
doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents:
14366
diff
changeset
|
70 ## @item @qcode{"iterations"}: The number of iterations taken. |
9635 | 71 ## @end itemize |
10821
693e22af08ae
Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents:
10793
diff
changeset
|
72 ## |
9635 | 73 ## @item lambda |
22764 | 74 ## @c FIXME: Something is output from the function, but what is it? |
75 ## Undocumented output | |
76 ## @end table | |
77 ## @seealso{lsqnonneg, qp, optimset} | |
9635 | 78 ## @end deftypefn |
79 | |
13027
b9a89ca0fb75
prevent optimization functions from setting ans in workspace at startup
John W. Eaton <jwe@octave.org>
parents:
11588
diff
changeset
|
80 ## PKG_ADD: ## Discard result to avoid polluting workspace with ans at startup. |
b9a89ca0fb75
prevent optimization functions from setting ans in workspace at startup
John W. Eaton <jwe@octave.org>
parents:
11588
diff
changeset
|
81 ## PKG_ADD: [~] = __all_opts__ ("pqpnonneg"); |
9635 | 82 |
22764 | 83 ## This is analogical to the lsqnonneg implementation, which is implemented |
84 ## from Lawson and Hanson's 1973 algorithm on page 161 of Solving Least Squares | |
85 ## Problems. It shares the convergence guarantees. | |
9635 | 86 |
22769 | 87 function [x, minval, exitflag, output, lambda] = pqpnonneg (c, d, x0 = [], |
88 options = struct ()) | |
9635 | 89 |
22764 | 90 ## Special case: called to find default optimization options |
91 if (nargin == 1 && ischar (c) && strcmp (c, "defaults")) | |
26138
804e18e3e320
Reenable query of optimization options (bugs #54952 and #55089).
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
25579
diff
changeset
|
92 x = struct ("MaxIter", 1e5); |
17312
088d014a7fe2
Use semicolon after "return" statement in core m-files.
Rik <rik@octave.org>
parents:
17281
diff
changeset
|
93 return; |
9635 | 94 endif |
95 | |
28789
28de41192f3c
Eliminate unneeded verification of nargin, nargout in m-files.
Rik <rik@octave.org>
parents:
27923
diff
changeset
|
96 if (nargin < 2) |
9635 | 97 print_usage (); |
98 endif | |
99 | |
22764 | 100 if (! (isnumeric (c) && ismatrix (c)) || ! (isnumeric (d) && ismatrix (d))) |
101 error ("pqpnonneg: C and D must be numeric matrices"); | |
102 endif | |
103 if (! issquare (c)) | |
104 error ("pqpnonneg: C must be a square matrix"); | |
105 endif | |
106 | |
107 if (! isstruct (options)) | |
108 error ("pqpnonneg: OPTIONS must be a struct"); | |
109 endif | |
110 | |
9635 | 111 ## Lawson-Hanson Step 1 (LH1): initialize the variables. |
112 n = columns (c); | |
22764 | 113 if (isempty (x0)) |
114 ## Initial guess is all zeros. | |
9635 | 115 x = zeros (n, 1); |
116 else | |
117 ## ensure nonnegative guess. | |
22764 | 118 x = max (x0, 0); |
9635 | 119 endif |
120 | |
121 max_iter = optimget (options, "MaxIter", 1e5); | |
122 | |
123 ## Initialize P, according to zero pattern of x. | |
124 p = find (x > 0).'; | |
125 ## Initialize the Cholesky factorization. | |
126 r = chol (c(p, p)); | |
127 usechol = true; | |
128 | |
129 iter = 0; | |
130 | |
131 ## LH3: test for completion. | |
132 while (iter < max_iter) | |
133 while (iter < max_iter) | |
20735
418ae0cb752f
Replace ++,-- with in-place operators for performance.
Rik <rik@octave.org>
parents:
20165
diff
changeset
|
134 iter += 1; |
9635 | 135 |
136 ## LH6: compute the positive matrix and find the min norm solution | |
137 ## of the positive problem. | |
138 if (usechol) | |
139 xtmp = -(r \ (r' \ d(p))); | |
140 else | |
141 xtmp = -(c(p,p) \ d(p)); | |
142 endif | |
143 idx = find (xtmp < 0); | |
144 | |
11587
c792872f8942
all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
145 if (isempty (idx)) |
9635 | 146 ## LH7: tmp solution found, iterate. |
147 x(:) = 0; | |
148 x(p) = xtmp; | |
149 break; | |
150 else | |
151 ## LH8, LH9: find the scaling factor. | |
152 pidx = p(idx); | |
22764 | 153 sf = x(pidx) ./ (x(pidx) - xtmp(idx)); |
9635 | 154 alpha = min (sf); |
155 ## LH10: adjust X. | |
156 xx = zeros (n, 1); | |
157 xx(p) = xtmp; | |
158 x += alpha*(xx - x); | |
159 ## LH11: move from P to Z all X == 0. | |
160 ## This corresponds to those indices where minimum of sf is attained. | |
19833
9fc020886ae9
maint: Clean up m-files to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19697
diff
changeset
|
161 idx = idx(sf == alpha); |
9635 | 162 p(idx) = []; |
163 if (usechol) | |
164 ## update the Cholesky factorization. | |
165 r = choldelete (r, idx); | |
166 endif | |
167 endif | |
168 endwhile | |
11587
c792872f8942
all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
169 |
9635 | 170 ## compute the gradient. |
171 w = -(d + c*x); | |
172 w(p) = []; | |
173 if (! any (w > 0)) | |
174 if (usechol) | |
175 ## verify the solution achieved using qr updating. | |
22764 | 176 ## In the best case, this should only take a single step. |
9635 | 177 usechol = false; |
178 continue; | |
179 else | |
180 ## we're finished. | |
181 break; | |
182 endif | |
183 endif | |
184 | |
185 ## find the maximum gradient. | |
186 idx = find (w == max (w)); | |
187 if (numel (idx) > 1) | |
188 warning ("pqpnonneg:nonunique", | |
11588
d5bd2766c640
style fixes for warning and error messages in script files
John W. Eaton <jwe@octave.org>
parents:
11587
diff
changeset
|
189 "a non-unique solution may be returned due to equal gradients"); |
9635 | 190 idx = idx(1); |
191 endif | |
21751
b571fc85953f
maint: Use two spaces after period to indicate sentence break.
Rik <rik@octave.org>
parents:
21178
diff
changeset
|
192 ## move the index from Z to P. Keep P sorted. |
9635 | 193 z = [1:n]; z(p) = []; |
194 zidx = z(idx); | |
195 jdx = 1 + lookup (p, zidx); | |
196 p = [p(1:jdx-1), zidx, p(jdx:end)]; | |
197 if (usechol) | |
198 ## insert the column into the Cholesky factorization. | |
10200
7c1b1c084af1
handle cholesky update failure in pqpnonneg
Jaroslav Hajek <highegg@gmail.com>
parents:
9635
diff
changeset
|
199 [r, bad] = cholinsert (r, jdx, c(p,zidx)); |
7c1b1c084af1
handle cholesky update failure in pqpnonneg
Jaroslav Hajek <highegg@gmail.com>
parents:
9635
diff
changeset
|
200 if (bad) |
7c1b1c084af1
handle cholesky update failure in pqpnonneg
Jaroslav Hajek <highegg@gmail.com>
parents:
9635
diff
changeset
|
201 ## If the insertion failed, we switch off updates and go on. |
7c1b1c084af1
handle cholesky update failure in pqpnonneg
Jaroslav Hajek <highegg@gmail.com>
parents:
9635
diff
changeset
|
202 usechol = false; |
7c1b1c084af1
handle cholesky update failure in pqpnonneg
Jaroslav Hajek <highegg@gmail.com>
parents:
9635
diff
changeset
|
203 endif |
9635 | 204 endif |
205 | |
206 endwhile | |
207 ## LH12: complete. | |
208 | |
209 ## Generate the additional output arguments. | |
22764 | 210 if (isargout (2)) |
9635 | 211 minval = 1/2*(x'*c*x) + d'*x; |
212 endif | |
22764 | 213 if (isargout (3)) |
214 if (iter >= max_iter) | |
215 exitflag = 0; | |
216 else | |
217 exitflag = iter; | |
218 endif | |
9635 | 219 endif |
22764 | 220 if (isargout (4)) |
9635 | 221 output = struct ("algorithm", "nnls-pqp", "iterations", iter); |
222 endif | |
22764 | 223 if (isargout (5)) |
9635 | 224 lambda = zeros (size (x)); |
225 lambda(p) = w; | |
226 endif | |
227 | |
228 endfunction | |
229 | |
14363
f3d52523cde1
Use Octave coding conventions in all m-file %!test blocks
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
230 |
9635 | 231 %!test |
232 %! C = [5 2;2 2]; | |
233 %! d = [3; -1]; | |
14363
f3d52523cde1
Use Octave coding conventions in all m-file %!test blocks
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
234 %! assert (pqpnonneg (C, d), [0;0.5], 100*eps); |
9635 | 235 |
236 ## Test equivalence of lsq and pqp | |
237 %!test | |
238 %! C = rand (20, 10); | |
239 %! d = rand (20, 1); | |
14363
f3d52523cde1
Use Octave coding conventions in all m-file %!test blocks
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
240 %! assert (pqpnonneg (C'*C, -C'*d), lsqnonneg (C, d), 100*eps); |
f3d52523cde1
Use Octave coding conventions in all m-file %!test blocks
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
241 |
22764 | 242 # Test input validation |
243 %!error pqpnonneg () | |
244 %!error pqpnonneg (1) | |
245 %!error pqpnonneg (1,2,3,4,5) | |
246 %!error <C .* must be numeric matrices> pqpnonneg ({1},2) | |
247 %!error <C .* must be numeric matrices> pqpnonneg (ones (2,2,2),2) | |
248 %!error <D must be numeric matrices> pqpnonneg (1,{2}) | |
249 %!error <D must be numeric matrices> pqpnonneg (1, ones (2,2,2)) | |
250 %!error <C must be a square matrix> pqpnonneg ([1 2], 2) | |
251 %!error <OPTIONS must be a struct> pqpnonneg (1, 2, [], 3) |