MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn moreOpportunities for recent engineering grads.

Apply Today**New to MATLAB?**

For a row vector V=[7 1 2 -3] has one sign change from 2 to -3. So N=Sign_Changes(V) must return N=1;

V=[5 9 -2 7];

has two sign changes one from 9 to -2 and second -2 to 7, Thus N=2;

Similarly

V=[-4 -6 -7 -5 -6] and V=[3 7 6 5 6 7 8 7 6]

has no sign changes.

34 correct solutions
13 incorrect solutions

Last solution submitted on May 25, 2015