bugGNU Octave - Bugs: bug #57045, Missing matlab function: contains

 
 

bug #57045: Missing matlab function: contains

Submitter:  amrit karmacharya <amritkarma>
Submitted:  Fri 11 Oct 2019 10:41:41 PM UTC
   
 
Category:  Octave Function Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Matlab Compatibility
Status:  Duplicate Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * 5.1.0 Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 03 Mar 2020 04:29:01 PM UTC, comment #4: 

@shikoz:
This bug report has been closed as a duplicate. Please don't reuse it and follow up in the earlier report as indicated in comment #1:
bug #56065

Philip Nienhuis <philipnienhuis>
Group Member
Tue 03 Mar 2020 02:51:42 PM UTC, comment #3: 

I tried to write the file in a way that we able to merge to our system Is this okay?

(file #48547)

Ahmed ElShreif <shikoz>
Fri 01 Nov 2019 10:22:40 PM UTC, comment #2: 

The function here doesn't work in the cases as specified by matlab. The following are examples taken from Matlab help/documentation


    STR = 'data.tar.gz';
    P = 'tar';
    assert(contains(STR,P),true)

    chr = 'peppers, onions, and mushrooms';
    assert(contains(chr,'onion'),true);
    assert(contains(chr,'pineapples'),false);

    STR = {'abstracts.docx','data.tar.gz'};
    P = 'tar';
    assert(contains(STR,P),logical([0 1]))

    STR = 'data.tar.gz';
    P = {'docx','tar'};
    assert(contains(STR,P),true)

    str = {'Mary Ann Jones','Christopher Matthew Burns','John Paul Smith'};
    pattern = {'Ann','Paul'};
    assert(contains(str,pattern),logical([1 0 1]))
    assert(str(contains(str,pattern)),{'Mary Ann Jones','John Paul Smith'})

    STR ={'DATA.TAR.GZ','SUMMARY.PPT'};
    P = 'tar';
    assert(contains(STR,P,'IgnoreCase',true),logical([1 0]))

The code submitted here passes the first two cases, but not the third or later. The third assertion should be a fundamental test that is not passed, whereas the later assertions are 'advanced' features in order of what I think is important (I use the fourth case frequently, but none of the later cases).

Marshall <marsian>
Fri 11 Oct 2019 10:51:45 PM UTC, comment #1: 

Thank you for your bug report. This particular function has already been reported and discussed on bug #56065. Closing this report as a duplicate.

Mike Miller <mtmiller>
Group Member
Fri 11 Oct 2019 10:41:41 PM UTC, original submission:  

Matlab Function contains https://www.mathworks.com/help/symbolic/mupad_ref/contains.html is not available.

amrit karmacharya <amritkarma>

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #48547:  mypatch.patch added by shikoz (4KiB - text/x-patch - I tried to format the file and add some comments)
file #48546:  mypatch.patch added by shikoz (4KiB - text/x-patch - I tried to format the file and add some comments)

 

Digest:
   bug dependencies.

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by shikoz (Updated the item)
  • -email is unavailable- added by marsian (Posted a comment)
  • -email is unavailable- added by amritkarma (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 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2020-03-03 shikoz Attached File- Added mypatch.patch, #48547
    2020-03-03 shikoz Attached File- Added mypatch.patch, #48546
    2019-10-11 mtmiller StatusNone Duplicate
        Open/ClosedOpen Closed
        Dependencies- Depends on bugs #56065

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code