How to vectorize integral function in a code?

16 views (last 30 days)
syms r syms p fun1=@(r)(r.^((1-bta)/alpha)/pi*alpha).*exp(-r.^(1/alpha)).*(r*sin(pi*(1-bta))-z*sin(pi*(1-bta+alpha)))/((r.^2-2*r*z*cos(pi*alpha)+z.^2)); % w=r*(eps^(1/alpha))*sin(r/alpha)+r*(1+(1-bta)/alpha);
fun2=@(p)((eps^(1+(1-bta)/alpha))/(2*pi*alpha))*((exp((eps^(1/alpha))*cos(p/alpha)).*... (cos(p*(eps^(1/alpha))*sin(p/alpha)+p*(1+(1-bta)/alpha))+1i*sin(p*(eps^(1/alpha))*sin(p/alpha)+p*(1+(1-bta)/alpha)))))/(eps*exp(1i*p)-z); if (bta<=1) sm=integral(fun1,0,ro,'ArrayValued',true); else sm=(integral(fun1,1,ro,'ArrayValued',true)+integral(fun2,(-alpha*pi),(alpha*pi),'ArrayValued',true)); end

Answers (0)

Community Treasure Hunt

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

Start Hunting!