I am trying to solve the system above.I think I got right the first part of the quation with a for loop(code bellow)
L = 51; ws1 = 0.4*pi; wp1 = 0.5*pi; Ks1 = 1; Kp = 2; wo = (ws1+wp1)/2; G = 1000; w = [0:(G)]*pi/G; W = Ks1*(w<=ws1) + Kp*(w>=wp1) D = (wo>=w); N=(L-1)/2 m=0:N k=1:1001for i = 0:N F(i+1,:)=sum(arrayfun(@(k) (W(k).^2).*D(k).*cos(w(k).*i), 1:1000))end
I am struggling though in the second part.My code looks like this but it does not seem to work.
for i = 0:N for p = 0:N F2=@(k)(W(k).^2).*D(k).*(cos(w(k).*i).*(cos(w(k).*p))') end M[i+1,p+1]=sum[arrayfun(@(k) F2(k), 1:1000)]end
Does anyone know how I could possibly fix that.I also download the symbolic math toolbox but I was not able to find something to help me with that.
Best Answer