MATLAB: It shows error for the following code..How to rectify it

k=rand(192,1)
syms k1 t
for i=1:4
k1=k((48*i),((48*i)-47))
a1 = symsum(k1*(2^(t-(48*i)+47)),t,((48*i)-47),(48*i));
a=a1/(2^48)
end

Best Answer

You consistently try to reach columns other than 1 for k while i is not equal to 1, which is invalid.
k=rand(192,1);
syms k1 t
for i=1:4
k1=k(48*i,1)
a1 = symsum(k1*(2^(t-(48*i)+47)),t,((48*i)-47),(48*i));
a=a1/(2^48)
end
Related Question