octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #38999] optimset("Disp", "off")


From: Muhali
Subject: [Octave-bug-tracker] [bug #38999] optimset("Disp", "off")
Date: Wed, 15 May 2013 14:20:31 +0000
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:20.0) Gecko/20100101 Firefox/20.0

URL:
  <http://savannah.gnu.org/bugs/?38999>

                 Summary: optimset("Disp", "off")
                 Project: GNU Octave
            Submitted by: muhali
            Submitted on: Wed 15 May 2013 07:20:30 AM PDT
                Category: None
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: None
                  Status: None
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: dev
        Operating System: GNU/Linux

    _______________________________________________________

Details:

octave warns and does not accept


optimset("Disp", "off")


while ML accepts "Disp" as long as it remains unambiguous (which I would
prefer).

Here is a patch that fixes it (using the deprecated strmatch which I found
easier to handle). 


--- old/optimset.m
+++ new/optimset.m
@@ -135,11 +135,14 @@
     for [val, key] = new
       if (validation)
         ## Case insensitive lookup in all options.
-        i = lookup (lopts, tolower (key));
+       i = strmatch(tolower (key), lopts) ;
         ## Validate option.
-        if (i > 0 && strcmpi (opts{i}, key))
+        if (length(i) == 1)
           ## Use correct case.
           key = opts{i};
+        elseif (length(i) > 1)
+         fmt = [" (" repmat("%s, ", 1, length(i)-1) "%s)"] ;
+          warning (["ambiguous option: %s" fmt], key, opts{i});
         else
           warning ("unrecognized option: %s", key);
         endif





    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?38999>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]