I am trying to employ dsp.ZeroCrossingDetector to count number of zero crossings of a signal. Consider the following:
x = 0 : pi/180 : 4*pi;y = sin(x);zcd = dsp.ZeroCrossingDetector;n = zcd(y);release(zcd);
It is expected that size of n be 1*1, that is a sclar, but MATLAB returns n as vector of zeros with the same size as x.
How can I solve this problem?
Best Answer