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

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

[Octave-bug-tracker] [bug #35121] cellfun() obsolete option 'uniform'


From: Rik
Subject: [Octave-bug-tracker] [bug #35121] cellfun() obsolete option 'uniform'
Date: Tue, 20 Dec 2011 19:13:38 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:5.0) Gecko/20100101 Firefox/5.0

Follow-up Comment #5, bug #35121 (project octave):

Check the function validatestring() which was explicitly designed to help
handle these Matlab input quirks.  It can gracefully expand short options to
long options.  The help text is


 -- Function File: VALIDSTR = validatestring (STR, STRARRAY)
 -- Function File: VALIDSTR = validatestring (STR, STRARRAY, FUNCNAME)
 -- Function File: VALIDSTR = validatestring (STR, STRARRAY, FUNCNAME,
          VARNAME)
 -- Function File: VALIDSTR = validatestring (..., POSITION)
     Verify that STR is an element, or substring of an element, in
     STRARRAY.

     When STR is a character string to be tested, and STRARRAY is a
     cellstr of valid values, then VALIDSTR will be the validated form
     of STR where validation is defined as STR being a member or
     substring of VALIDSTR.  This is useful for both verifying and
     expanding short options, such as "r", to their longer forms, such
     as "red".  If STR is a substring of VALIDSTR, and there are
     multiple matches, the shortest match will be returned if all
     matches are substrings of each other.  Otherwise, an error will be
     raised because the expansion of STR is ambiguous.  All comparisons
     are case insensitive.

     The additional inputs FUNCNAME, VARNAME, and POSITION are optional
     and will make any generated validation error message more specific.

     Examples:

          validatestring ("r", {"red", "green", "blue"})
             => "red"

          validatestring ("b", {"red", "green", "blue", "black"})
             => error: validatestring: multiple unique matches were found for
'b':
                blue, black

     See also: strcmp, strcmpi



But cellfun, which is a C++ function, has no obvious way to call the
validatestring.m file.



    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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