Count the changes in an array Your task today is to write a program or function that takes an array of integers, and counts the number of times, reading it left to right, that the value changes. This is easier to show with an example: [1 1 1 2 2 5 5 5 5 17 3] =&gt; [1 1 1 **2** 2 **5** 5 5 5 **17** **3**] =&gt; 4

Test case:

Input           |   Output
[]              |   0
[0]             |   0
[0 1]           |   1
[0 0]           |   0
[1 2 3 17]      |   3
[1 1 1 2 2 3]   |   2
[-3 3 3 -3 0]   |   3


This is code-golf, fewest bytes wins!
MATL, 2 bytes
dz

Try it online! Or verify all test cases.
Explanation
     % Implicit input
d    % Consecutive differences
z    % Number of nonzeros
     % Implicit display