Is this code for doing a moving average correct? Is this code for doing a moving average correct?

y=conv(x, ones(1,100)/100);


I want to filter my speech signal with moving average filter in code.  I think that I can use convolution for this.
Yes, this code is correct for implementing a moving average filter. 

Nevertheless I do recommend to use the in-built smooth function in MATLAB.

y = smooth(x, 100, 'moving')