bugGNU Octave - Bugs: bug #54417, setstr function missing

 
 

bug #54417: setstr function missing

Submitted by:  Arnaud Delorme <arnodelorme>
Submitted on:  Wed 01 Aug 2018 07:11:24 AM UTC  
 
Category:  Octave Function Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Matlab Compatibility
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  Closed
Release:  4.4.0 Operating System:  Any

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Wed 01 Aug 2018 06:24:19 PM UTC, comment #4:

Philip: Yeah, I already created a legacy directory (though it wasn't pushed when you commented):

http://hg.savannah.gnu.org/hgweb/octave/rev/a3448e97ccc8

John W. Eaton <jwe>
Project Administrator
Wed 01 Aug 2018 06:19:06 PM UTC, comment #3:

Sure I'm fine with it.
A few years back I pleaded to keep strread.m and that was also granted.
In my POV the distinction is that there's no 1:1 drop-in replacement for strread, while there is for setstr.

In recent years Mathworks has changed their policy in that AFAICS almost all previously deprecated functions now seem to just be "not recommended".

Perhaps it's better to clearly distinguish between 'legacy' Matlab functions and undocumented Matlab functionality. In principle, requests for the former can be granted, for the latter turned down.
Would that work?

Philip Nienhuis <philipnienhuis>
Project Member
Wed 01 Aug 2018 05:40:15 PM UTC, comment #2:

In email, Arnaud wrote:

We've kept isstr around for similar reasons, even though it has been documented for more than a decade (maybe two!) that it will be removed from a future version of Matlab. So sure, we could bring this function back from the dead. I pushed the following changeset on stable and merged with default:

http://hg.savannah.gnu.org/hgweb/octave/rev/216321ca4cc4

That said, I want to be clear that I don't think we should go chasing every undocumented Matlab function or feature. But this case is different: the function does exist in Matlab and is documented, it was just marked at one point for possible future removal.

John W. Eaton <jwe>
Project Administrator
Wed 01 Aug 2018 08:09:44 AM UTC, comment #1:

After typing "help setstr", Matlab r2012a says:
"setstr will be removed in a future release. Use CHAR instead."

Matlab r2018b says:
"setstr is not recommended. Use CHAR instead."

So better fix your Matlab code then :-)

If you really insist in using code in Octave that is deprecated by Matlab, define the following function somewhere in your path, of maybe type it in .octaverc:

function a = setstr (b)
a = char (b);
endfunction

(Closing with "invalid")

Philip Nienhuis <philipnienhuis>
Project Member
Wed 01 Aug 2018 07:11:24 AM UTC, original submission:

It is synonym to char. Present in Matlab 5.3 to 2018a but absent in Octave.

Arnaud Delorme <arnodelorme>

 

(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 jwe (Posted a comment)
  • -email is unavailable- added by arnodelorme (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

     

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-08-01 jwe StatusInvalid => Fixed
    2018-08-01 philipnienhuis StatusNone => Invalid
        Open/ClosedOpen => Closed
        Operating SystemMac OS => Any

    Back to the top


    Powered by Savane 3.3