Hell, Im NEW to Matlab and I'm trying to plot the the stem function for the decimate sequence. I got the error msg saying "Index exceeds matrix dimension". Here is my code: The question is to use the the function decimate, using factor of 4 decimal and use the stem function to plot the original signal and the decimate. Use both default IRR and FIR decimate filter.
n1=0:100;x1=cos(.15*pi.*n1);d=decimate(x1,4);subplot(2,1,1);y1-stem(0:100,x(1:101), 'filled','markersize',3);title('original signal');subplot(2,1,2);y11=stem(0:100,d(1:100), 'filled','markersize',3); % ERROR MSG SHOWS HERE.
title('decimate signal);
Could someone help to explain how I select the index/range for the "statment y11"? Appreciate much for your time and help. Thank you
Best Answer