The warning is shown because the syntax used is not proper. At present, there are two algorithms supported by the dsp.MovingAverage system object, one is the sliding window algorithm and the other is exponential weighing, as an example the correct syntax for specifying these are respectively:
movavgWindow = dsp.MovingAverage(10);
movavgExp = dsp.MovingAverage('Method','Exponential weighting',...
In your code, you seem tohave mixed the two, hence the warning.
In my understanding you would like to specify a certain fixed number of elements, let's say k, over which you want to calculate the moving average but with exponential weighing algorithm. Now I am assuming that, you would want to partition your data into k independent portions i.e. the average taken over t(i+1), t(i + 2) ,..., t(i+k) is independent of the average taken over t(i+k+1), t(i+k+2) , ... , t(i + 2k), where t is a 1 - D vector of data points.
In that case, you can use the "reset" function of the dsp.MovingAverage system object. Note that:
As an example:
for i = 1:length(t)
y = movavgexp(t(i));
if mod(i,k) == 0