Navigation

Operators and Keywords

Function List:

C++ API

runlength.m File Reference


Functions

endfunction !assert (runlength([2 2 0 4 4 4 0 1 1 1 1]),[2 1 3 1 4])

Variables

 function [count, value]
 value = x(idx)
 count = diff ([0 idx])

Function Documentation

endfunction !assert ( runlength([2 2 0 4 4 4 0 1 1 1 1])   ) 


Variable Documentation

count = diff ([0 idx])

Initial value:

 runlength (x)
  idx = [find(x(1:end-1) != x(2:end)), length(x)]

value = x(idx)