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

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

[Octave-bug-tracker] [bug #36555] strfind() should work with numeric arr


From: Nicholas Jankowski
Subject: [Octave-bug-tracker] [bug #36555] strfind() should work with numeric arrays
Date: Fri, 18 Dec 2020 16:05:10 -0500 (EST)
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36

Follow-up Comment #4, bug #36555 (project octave):

behavior still present in Octave 6.1.0

Matlab 2020b:

>> strfind([1 2 3], [2 3])
ans =
     2
>> strfind([1.1 2 3], [2 3])
ans =
     2
>> strfind([1 2.1 3], [2 3])
ans =
     []
>> strfind([1 2.1 3], [2.1 3])
ans =
     2
>> strfind([1 2+2i 3], [2+2i 3])
ans =
     2
>> strfind([1 2 3], [2+2i 3])
ans =
     []


Octave 6.1.0:

octave:1> strfind([1 2 3],[2 3])
error: strfind: PATTERN must be a string or cell array of strings
(same for all other combinations above)


since matlab doc says input can be a char vector, was wondering if it was just
operating on any integer array, but appears it doesn't even error on
non-integers. it's just doing a numerical pattern match of whatever you feed
it.

    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?36555>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

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