bugGNU Octave - Bugs: bug #35121, cellfun() obsolete option 'uniform'

 
 

bug #35121: cellfun() obsolete option 'uniform'

Submitter:  None
Submitted:  Mon 19 Dec 2011 11:08:41 PM UTC
   
 
Category:  Interpreter Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Matlab Compatibility
Status:  Fixed Assigned to:  None
Originator Name:  J.J. Green Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * dev
Operating System:  * GNU/Linux Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Tue 20 Dec 2011 10:15:15 PM UTC, comment #6: 

I checked in the following changeset.

http://hg.savannah.gnu.org/hgweb/octave/rev/9aff66860e03

John W. Eaton <jwe>
Group administrator
Tue 20 Dec 2011 07:13:38 PM UTC, comment #5: 

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.


Rik <rik5>
Group administrator
Tue 20 Dec 2011 07:32:21 AM UTC, comment #4: 

Also, in Matlab 'un' works, but 'u'
fails, so it appears to not be case sensitive.

Michael Godfrey <godfrey>
Group Member
Tue 20 Dec 2011 06:07:44 AM UTC, comment #3: 

Maybe it is just that Matlab accepts any unique parameter. Can you check to see whether it also accepts "uniformoutpu", "uniformoutp", "uniformout", ..., "u"?

Matlab (R2009b)  accepts all the shortenings until 'U'
which fails.

Michael

Michael Godfrey <godfrey>
Group Member
Tue 20 Dec 2011 04:37:58 AM UTC, comment #2: 

Maybe it is just that Matlab accepts any unique parameter.  Can you check to see whether it also accepts "uniformoutpu", "uniformoutp", "uniformout", ..., "u"?

John W. Eaton <jwe>
Group administrator
Tue 20 Dec 2011 03:58:19 AM UTC, comment #1: 

Are we really chasing after obsolete and undocumented Matlab features?

I'm a little reluctant to apply this change without some thought. Would you agree to apply it with a warning that this option is obsolete?

Jordi GutiƩrrez Hermoso <jordigh>
Group Member
Mon 19 Dec 2011 11:08:41 PM UTC, original submission:  

The Matlab cellfun() function accepts the 'uniform' option as equivalent to 'UniformOutput' (up to R2011b at least).  The former would seem to be obsolete, but is in significant use in the wild. It would be useful if Octave's cellfun() did likewise.

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by godfrey (Posted a comment)
  • -email is unavailable- added by jwe (Posted a comment)
  • -email is unavailable- added by jordigh (Posted a comment)
  • -email is unavailable- added by None (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2011-12-20 jwe StatusNone Fixed
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code