Hi,everyone.I got a problem of doing numeric integral on the matrix H (which is at the bottom part of my code).
The code works fine but I would like to speed it up? Am I doing something stupid to make it slow?Thanks for your help.
a0=(log(Z02./Z01))./(2..*L);
Z1=[50 55 60 65 70 80 75];
app_cos=0.5./ac.*log(Z1(s+1)./Z1(s)).*sin(ac./2.*(w./v).*c).*cos(((ac+1)./2).*(w./v).*c)./sin(((c.*w)./(2.*v)));
app_sin=0.5./ac.*log(Z1(s+1)./Z1(s)).*sin(ac./2.*(w./v).*c).*sin(((ac+1)./2).*(w./v).*c)./sin(((c.*w)./(2.*v)));
Ga(s)=(app_cos-(1i.*amp.*app_sin));
Ta=(1-(abs(Ga(1:1:end)).^2));
D1(t)=prod(Ta(1:t))./(1+(sum(C1(1:t))));
g=(v.^2.*w.^2.*cos((2.*w.*(- y + x))./v).*cos(20.*sym(pi).*m.*x).*cos(20.*sym(pi).*n.*y) + 10.*sym(pi).*m.*v.^3.*w.*sin(20.*sym(pi).*m.*x).*sin((2.*w.*(- y + x))./v).*cos(20.*sym(pi).*n.*y) - 10.*sym(pi).*n.*v.^3.*w.*sin(20.*sym(pi).*n.*y).*sin((2.*w.*(- y + x))./v).*cos(20.*sym(pi).*m.*x) + 100.*m.*n.*v.^4.*sym(pi).^2.*sin(20.*sym(pi).*m.*x).*sin(20.*sym(pi).*n.*y).*cos((2.*w.*(- y + x))./v))./(4.*(w.^2 - 100.*sym(pi).^2.*m.^2.*v.^2).*(w.^2 - 100.*sym(pi).^2.*n.^2.*v.^2));
Ht{p,q}=matlabFunction(((subs(g,[x y],[x2 y2])-subs(g,[x y],[x1 y1]))*Dm(p,q)));
H=integral(Hi,w1,w2,"ArrayValued",true)