dpb <
no...@non.net> wrote in message <k27jl0$n1v$
1...@speranza.aioe.org>...
Using the Command Window I understand that is a method to count the number of (-1) in the result.
The expression t-[t(2:end),0] executes the difference among each terms of the t vector.
Considering t = [0, 0, 1, 0, 1, 0, 0, 1, 0];
the expression t-[t(2:end),0] gives as result [0 -1 1 -1 1 0 -1 1 0]
so it computes:
0-0 = 0
0-1 = -1
1-0 = 1
and so on
Why didn't I use the Command Window before? :-)