Info

This question is closed. Reopen it to edit or answer.

im new to matlab, does any one know , how to iterate 8 times ?

1 view (last 30 days)
,h=[.482962913145,.836516303738,.224143868041,-1.2940952251];
convolve(h,h/2(in time));
convolve(h/2,h/4);.....up to 8 times

Answers (1)

Jon
Jon on 16 Sep 2019
You could do this with a for loop, something like this
h=[.482962913145,.836516303738,.224143868041,-1.2940952251];
numIter = 8; % number of iterations
% preallocate array to hold results, one row for each convolution
R = zeros(numIter,2*length(h)-1);
for k = 1:numIter
R(k,:) = conv(h/(2^(k-1)),h/(2^k));
end

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!