Problem 42922. Zero Cross
Write a function that counts the number of times n a signal x changes sign.
Examples
x = [1 2 -3 -4 5 6 -7 8 -9 10 11] n = 6
x = [1 2 -3] n = 1
Solution Stats
Problem Comments
- 
		2 Comments
		Jan Orwat
    	on 27 Aug 2016
	
	
  	It would be beneficial for the problem if zeros were added to test cases, for example [...,1,2,0,-1,-2,...], [...,1,2,3,0,2,3,...], [...1,2,3,0,0,0,1,2,...], [...,1,2,0,0,-1,-2,...], etc.
		goc3
    	on 23 May 2018
	
	
  	Additional test cases have been added and the description slightly modified.
Solution Comments
Show commentsProblem Recent Solvers125
Suggested Problems
- 
         Project Euler: Problem 3, Largest prime factor 1639 Solvers 
- 
         Numbers with prime factors 2, 3 and 5. 586 Solvers 
- 
         
         335 Solvers 
- 
         convert matrix to single column 422 Solvers 
- 
         
         5725 Solvers 
More from this Author21
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!