Mercurial > hg > octave-lyh
diff scripts/optimization/sqp.m @ 11120:a44f979a35ce
style fixes for some .m files
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Wed, 20 Oct 2010 20:49:17 -0400 |
parents | 693e22af08ae |
children | 646063a22a35 |
line wrap: on
line diff
--- a/scripts/optimization/sqp.m +++ b/scripts/optimization/sqp.m @@ -234,13 +234,13 @@ obj_grd = @fd_obj_grd; have_hess = 0; if (iscell (objf)) - switch length (objf) - case {1} + switch (numel (objf)) + case 1 obj_fun = objf{1}; - case {2} + case 2 obj_fun = objf{1}; obj_grd = objf{2}; - case {3} + case 3 obj_fun = objf{1}; obj_grd = objf{2}; obj_hess = objf{3}; @@ -258,10 +258,10 @@ if (nargin > 2) ce_grd = @fd_ce_jac; if (iscell (cef)) - switch length (cef) - case {1} + switch (numel (cef)) + case 1 ce_fun = cef{1}; - case {2} + case 2 ce_fun = cef{1}; ce_grd = cef{2}; otherwise