changeset 31353:fa3ae8fd8449

normalize.m: correct error messages split across lines (bug #55765) * normalize.m: add brackets to split error messages to avoid truncating the message. Fix BISTs to match.
author Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
date Wed, 26 Oct 2022 18:05:19 -0400
parents 014648ce3267
children 38b954c0c0c1
files scripts/statistics/normalize.m
diffstat 1 files changed, 9 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/statistics/normalize.m	Wed Oct 26 17:32:52 2022 -0400
+++ b/scripts/statistics/normalize.m	Wed Oct 26 18:05:19 2022 -0400
@@ -206,8 +206,8 @@
         ##FIXME: remove error on next line when Tables is implemented
         error ("normalize: DataVariables method not yet implemented.");
         if (vararg_idx == (nargin - 1))
-          error ("normalize: DataVariables requires a table variable", ...
-                 " be specified");
+          error (["normalize: DataVariables requires a table variable", ...
+                 " be specified"]);
         elseif (datavariables_flag == true)
           error ("normalize: DataVariables may only be specified once");
         else
@@ -274,8 +274,8 @@
                 methodoption = nextprop;
                 vararg_idx++;
               else
-                error ("normalize: 'norm' option must be a positive scalar or ",
-                       "Inf");
+                error (["normalize: 'norm' option must be a positive ", ...
+                        "scalar or Inf"]);
               endif
             endif
             if (isempty (methodoption))
@@ -293,8 +293,8 @@
                 methodoption = nextprop;
                 vararg_idx++;
               else
-                error ("normalize: 'range' must be specified as a ", ...
-                        "2-element row vector [a b]");
+                error (["normalize: 'range' must be specified as a ", ...
+                        "2-element row vector [a b]"]);
               endif
             endif
             if (isempty (methodoption))
@@ -630,9 +630,9 @@
 %!error <may not be combined> normalize ([1 2 3], "norm", "zscore")
 %!error <unknown method> normalize ([1 2 3], "norm", "foo")
 %!error <too many methods specified> normalize ([1 2 3], "scale", "center", "norm")
-%!error <'norm' option must be a positive scalar or> normalize ([1 2 3], "norm", -1)
-%!error <'norm' option must be a positive scalar or> normalize ([1 2 3], "norm", -Inf)
-%!error <'norm' option must be a positive scalar or> normalize ([1 2 3], "norm", [1 2])
+%!error <'norm' option must be a positive scalar or Inf> normalize ([1 2 3], "norm", -1)
+%!error <'norm' option must be a positive scalar or Inf> normalize ([1 2 3], "norm", -Inf)
+%!error <'norm' option must be a positive scalar or Inf> normalize ([1 2 3], "norm", [1 2])
 %!error <'range' must be specified as> normalize ([1 2 3], "range", [1 2]')
 %!error <'range' must be specified as> normalize ([1 2 3], "range", [1 2 3])
 %!error <'range' must be specified as> normalize ([1 2 3], "range", 1)