bugGNU Octave - Bugs: bug #52647, missing function: erase...

 
 

bug #52647: missing function: erase (introduced Matlab 2016b)

Submitted by:  Thomas A. F. Thorne <tafthorne>
Submitted on:  Tue 12 Dec 2017 01:41:59 PM UTC  
 
Category: Octave FunctionSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Matlab Compatibility
Status: ConfirmedAssigned to: None
Originator Name: Thomas A. F. ThorneOpen/Closed: Open
Release: devOperating System: Any

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

(Jump to the original submission Jump to the original submission)

Fri 22 Dec 2017 04:04:06 PM UTC, comment #11:

A few coding style issues were there, which have been rectified now.

(file #42703)

Sahil Yadav <batterylow>
Thu 21 Dec 2017 01:20:46 PM UTC, comment #10:

Sahil and I have tested this code, and we now think it is ready to be used.
Because octave uses double and single quotes differently than Matlab, we cannot get 100% compatibility, but we think that this code is quite useful as it is. Some one tying to convert from matlab to octave will see a message that will help them make the changes for it to work on octave.

Sahil ask how to contribute to the octave code and I chose this as a starter project for him. I think he has great potential to become a real octave developer. I have a second project for him :-)
Doug

Doug Stewart <dastew>
Thu 21 Dec 2017 01:05:15 PM UTC, comment #9:

The code has been optimised a bit.

(file #42694)

Sahil Yadav <batterylow>
Mon 18 Dec 2017 08:42:35 AM UTC, comment #8:

We have unit-tested the function with the edge tests, if however, someone encounters any problem, suggestions/feedback, kindly let us know. Again, thanks to the contributors for helping me out at every step.

(file #42670)

Sahil Yadav <batterylow>
Sun 17 Dec 2017 04:03:24 AM UTC, comment #7:

Yes we are still working on it.

Doug Stewart <dastew>
Sun 17 Dec 2017 04:00:48 AM UTC, comment #6:

Is there a second version of erase.m coming? That was the suggestion from comment #4.

Rik <rik5>
Project Administrator
Thu 14 Dec 2017 05:16:39 PM UTC, comment #5:

I am providing here examples from 2017b for the purpose of test units. They mainly cover the logic for trailing whitespace (must be kept) and for overlapping matches.

Carnë Draug <carandraug>
Project Member
Wed 13 Dec 2017 03:37:27 PM UTC, comment #4:

I have suggested some improvements to Sahil, so an improved version is on its way.

Doug Stewart <dastew>
Wed 13 Dec 2017 01:15:21 PM UTC, comment #3:

I tried my best not to fail in any of the edge cases but if so happens, kindly let me know. Any other criticisms are welcomed as well. Thanks to 'doug_' and all others for helping me out. Further guidelines as to how can i test on standard unit tests will be appreciated.

Sahil Yadav <batterylow>
Tue 12 Dec 2017 04:29:21 PM UTC, comment #2:

There is a beginner who is starting by writing this as a M function. I will see how he makes out.

Doug Stewart <dastew>
Tue 12 Dec 2017 04:23:30 PM UTC, comment #1:

Confirmed. It often isn't worth it for Octave to follow Matlab too closely because they have a habit of changing their function names, discontinuing functions, altering the API, etc. If the function survives for a few years without change then it can be worth adopting.

In the mean time, you can have the same functionality with regexprep().

Rik <rik5>
Project Administrator
Tue 12 Dec 2017 01:41:59 PM UTC, original submission:

A new function was introduced in MATLAB R2016b that erases sub-strings within a string.

erase(string,sub-string)

with the return being the remains of the original string.

Full documentation available at:
https://uk.mathworks.com/help/matlab/ref/erase.html

Thomas A. F. Thorne <tafthorne>

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #42703:  erase.m added by batterylow (5KiB - text/x-objcsrc - in accordance with octave style guide)
file #42694:  erase.m added by batterylow (5KiB - text/x-objcsrc - final version -2)
file #42670:  erase.m added by batterylow (7KiB - text/x-objcsrc - final version till date)
file #42637:  erase.m added by batterylow (2KiB - text/x-objcsrc - I tried my best not to fail in any of the edge cases but if so happens, kindly let me know. Any other criticisms are welcomed as well. Thanks to 'doug_' for helping me out. Further guidelines as to how can i test on standard unit tests will be appreciated)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by batterylow (Updated the item)
  • -unavailable- added by batterylow
  • -unavailable- added by dastew (Posted a comment)
  • -unavailable- added by rik5 (Updated the item)
  • -unavailable- added by tafthorne (Submitted the item)
  •  

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

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 8 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 22 Dec 2017 04:04:06 PM UTCbatterylowAttached File-=>Added erase.m, #42703
    Thu 21 Dec 2017 01:05:15 PM UTCbatterylowAttached File-=>Added erase.m, #42694
    Mon 18 Dec 2017 08:42:35 AM UTCbatterylowAttached File-=>Added erase.m, #42670
    Wed 13 Dec 2017 01:12:46 PM UTCbatterylowAttached File-=>Added erase.m, #42637
      Carbon-Copy-=>Added batterylow
    Tue 12 Dec 2017 04:23:30 PM UTCrik5Operating SystemGNU/Linux=>Any
    Tue 12 Dec 2017 04:14:59 PM UTCrik5StatusNone=>Confirmed
      Release4.0.0=>dev

    Back to the top


    Powered by Savane 3.1-cleanup1