summaryrefslogtreecommitdiff
path: root/macros/clustersegment.sci
diff options
context:
space:
mode:
authorshamikam2017-11-07 15:59:48 +0530
committershamikam2017-11-07 15:59:48 +0530
commitc0c0582462720ed597b00e116506570577614e89 (patch)
tree31dedd23698e5357b19c810b7d7a8464100ef44a /macros/clustersegment.sci
downloadFOSSEE-Signal-Processing-Toolbox-c0c0582462720ed597b00e116506570577614e89.tar.gz
FOSSEE-Signal-Processing-Toolbox-c0c0582462720ed597b00e116506570577614e89.tar.bz2
FOSSEE-Signal-Processing-Toolbox-c0c0582462720ed597b00e116506570577614e89.zip
initial commit
Diffstat (limited to 'macros/clustersegment.sci')
-rw-r--r--macros/clustersegment.sci27
1 files changed, 27 insertions, 0 deletions
diff --git a/macros/clustersegment.sci b/macros/clustersegment.sci
new file mode 100644
index 0000000..07957ee
--- /dev/null
+++ b/macros/clustersegment.sci
@@ -0,0 +1,27 @@
+function c = clustersegment(s)
+//This function calculates boundary indexes of clusters of 1’s.
+//Calling Sequence
+//c = clustersegment(s)
+//Parameters
+//s: scalar, vector or matrix of real numbers (clusters of 1s)
+//c: output variable, cell array of size 1 by N, where N is the number of rows in s
+//Description
+//This is an Octave function.
+//This function calculates boundary indexes of clusters of 1’s.
+//This function calculates the initial and end indices of the sequences of 1's present in the input argument.
+//The output variable c is a cell array of size 1 by N, where N is the number of rows in s and each element has two rows indicating the initial index and end index of the cluster of 1's respectively. The indexing starts from 1.
+//Examples
+//y = clustersegment ([0,1,0,0,1,1])
+//y =
+// 2. 5.
+// 2. 6.
+
+funcprot(0);
+rhs = argn(2)
+if(rhs~=1)
+error("Wrong number of input arguments.")
+end
+
+c = callOctave("clustersegment", s)
+
+endfunction