# MATLAB: How to speed up integration

integralsintegratespeed integration

Hi,
I do integration in my code:
``% fun= @(teta) ((abs((((-1i.*(T.*(k0.*sin(teta)).^2+EI.*10.^9.*(k0.*sin(teta)).^4-rho.*A.*omega.^2))./(omega.*Zair))+((1i.*(EI.*10.^9.*(k0.*sin(teta)).^4-rho.*A.*omega.^2))./(omega.*Zair)))./((1-((1i.*(EI.*10.^9.*(k0.*sin(teta)).^4-rho.*A.*omega.^2))./(omega.*Zair))).*(1+((-1i.*(T.*(k0.*sin(teta)).^2+EI.*10.^9.*(k0.*sin(teta)).^4-rho.*A.*omega.^2))./(omega.*Zair)))))).^2).*sin(teta).*cos(teta)   tau_tr_dash= integral(fun,0,78,'ArrayValued',true);``
The process takes more than 10min!
How can I speed it up?
My whole code:
``function sandwich_unidirectional (rho_c,d,rho,EI,c,b,vc,Ec)f = [31.5 40 50 63 80 100 125 160 200 250 315 400 500 630 800 1000....    1250 1600 2000 2500 3150 4000 5000 6300 8000];     % frequency range [Hz]Zair=428 ; % air impedance at 0°C [N*s/m^3]%rho_c-core material densityM0=(rho_c*b*c)/6;E0=(Ec*10^9)/(1-vc^2);v0=vc/(1-vc);K=(E0*b)/(c*(1-v0^2));A=b*d; %-cross secional area of the face sheet%d-thickness of the face sheet%rho-density of sheet plate material%EI-flexural rigidity of the face sheetomega=2.*pi.*f;                                         % angular frequency [rad/s]c_air=331.6;                                              % sound speed in air at 0° [m/s]                                          k0=omega./c_air;%k=k0.*sin(teta)%c-thickness of the core%b-hight of the panel%vc-Poisson's ratio of the core%Ec-elastic modulus of the coreT=(E0*b)/(c*(1-v0^2));% fun= @(teta) ((abs((((-1i.*(T.*(k0.*sin(teta)).^2+EI.*10.^9.*(k0.*sin(teta)).^4-rho.*A.*omega.^2))./(omega.*Zair))+((1i.*(EI.*10.^9.*(k0.*sin(teta)).^4-rho.*A.*omega.^2))./(omega.*Zair)))./((1-((1i.*(EI.*10.^9.*(k0.*sin(teta)).^4-rho.*A.*omega.^2))./(omega.*Zair))).*(1+((-1i.*(T.*(k0.*sin(teta)).^2+EI.*10.^9.*(k0.*sin(teta)).^4-rho.*A.*omega.^2))./(omega.*Zair)))))).^2).*sin(teta).*cos(teta)   tau_tr_dash= integral(fun,0,78,'ArrayValued',true);TL=10.*log10(abs(1./tau_tr_dash))semilogx(f,TL,'k');grid onylabel('Transmission Loss [dB]');xlabel ('Frequency')title('Transmission Loss')hold onend``
Thanks for any suggestions,
Dominika