Scilab Function
Last update : 31/10/2005
findgrup - from the binary vector A the starting-
and endpositions of groups with 1 are determined
Calling Sequence
-
K = findgrup(a,modus)
Parameters
-
a
: row vector containing elements with range of value {0,1}
-
modus
: scalar value, range of value {0,1}. if modus is 0 (default),
leading and trailing 1-groups are not considered.
-
K
: matrix with two rows. The 1st row contains the start index of
the 1-group, the 2nd row the last index of a 1-group.
Description
-
This is a very usefull tool for e. g. selecting areas of interest
of time functions.
-
The function is converted from my MatLab functions
Examples
a=[1,1,1,0,0,0,1,1,0,0,0,1,1,1];
ki1=findgrup(a);
disp(ki1);
ki2=findgrup(a,1); //with Leading and trailing groups
disp(ki2);
See Also
findnext
,
Authors
-
Dr. Andreas Geissler geisslea@web.de