[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #60521] compatibility of strfind()
From: |
John Beale |
Subject: |
[Octave-bug-tracker] [bug #60521] compatibility of strfind() |
Date: |
Tue, 4 May 2021 10:39:37 -0400 (EDT) |
User-agent: |
Mozilla/5.0 (X11; CrOS armv7l 13597.84.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.187 Safari/537.36 |
URL:
<https://savannah.gnu.org/bugs/?60521>
Summary: compatibility of strfind()
Project: GNU Octave
Submitted by: jbeale
Submitted on: Tue 04 May 2021 02:39:35 PM UTC
Category: Octave Function
Severity: 3 - Normal
Priority: 5 - Normal
Item Group: Matlab Compatibility
Status: None
Assigned to: None
Originator Name:
Originator Email:
Open/Closed: Open
Release: 6.2.0
Discussion Lock: Any
Operating System: GNU/Linux
_______________________________________________________
Details:
The Octave 6.2 implementation of strfind() is not compatible with Matlab
R2021a, as described below. Matlab strfind() can work on type logical inputs,
which some published solutions rely on, and Octave fails unless it is type
char.
https://octave.discourse.group/t/find-start-index-of-group-of-nonzero-elements-in-vector/1113
Code demonstrating the problem of finding start/end indexes of groups of
non-zero elements (works in Matlab, but not Octave):
TestVec = [0 0 3 4 5 0 0 1 2 0 7 8 9];
mask = logical(TestVec);
starts = strfind([false, mask], [0 1]);
stops = strfind([mask, false], [1 0]);
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?60521>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
- [Octave-bug-tracker] [bug #60521] compatibility of strfind(),
John Beale <=