When strfind is updated in a later version of Octave it should include double numbers also. Matlab:

a = 1:10; a=a+.1
a =
1.1000 2.1000 3.1000 4.1000 5.1000 6.1000 7.1000 8.1000 9.1000 10.1000
strfind(a, [2.1 3.1])
ans =
2

This works perfect in Matlab but not in Octave. Is there a workarround I haven’t found? Because I think this is a very helpful behavior even if it’s not documented. And a clever workaround would be highly appreciated, especially when this never will be implemented (according @Pantxo).

Windows 7

Octave Version 7.1

Installation method: e.g. Downloaded and installed “octave-7.1-w64-installer.exe” from Download

Just a last remark: Your first suggestion works fine and is easy to expand for more patterns. The scond suggestion I had to modify a little bit, see below. Cause I got a nonconformace error and I want to have it ML-compatible. A review is welcome.

a = 1:10; a=a+.1; a =[a a]
pat = [ 4.1 5.1 6.1]
lgl = true (1, numel(a));
len = numel (pat);
for i = 1:len
res = (a(i:(end-len+i)) == pat(i));
lgl = lgl(1:length(res)) & res;
end
iNdex = find (lgl)