[Top][All Lists]

[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)


I used to locate a sequence of numbers in a longer vector via findstr(),
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,

PS: In Matlab 2012 strfind() as well as findstr() can be used with

View this message in context:
Sent from the Octave - General mailing list archive at

reply via email to

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