help-octave
[Top][All Lists]
Advanced

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

find subvector with findstr / strfind


From: inor0627
Subject: find subvector with findstr / strfind
Date: Wed, 17 Feb 2016 05:13:55 -0800 (PST)

Hello,

I used to locate a sequence of numbers in a longer vector via findstr(),
e.g.
findstr( [3 4 5 3 4] , [3 4] )
ans =  1   4. 
Today I came across the information that findstr() is scheduled for
deprecation and one should use strfind() instead. 

However, trying
strfind( [3 4 5 3 4] , [3 4] )
results in:
error: strfind: PATTERN must be a string or cell array of strings.

Will non-strings be supported in a future version of strfind() or should I
use another approach for finding subvectors?

My octave version is 4.0.0 on Win7.

Best regards,
Ingo

PS: In Matlab 2012 strfind() as well as findstr() can be used with
non-strings.





--
View this message in context: 
http://octave.1599824.n4.nabble.com/find-subvector-with-findstr-strfind-tp4674858.html
Sent from the Octave - General mailing list archive at Nabble.com.



reply via email to

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