Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
Drexel University or The Math Forum.



Re: Speedup this function
Posted:
Jan 21, 2013 1:46 AM


Currently I'm running the following alternative version of the above function:
function beta = beta_calc(k,c,gamma) k_1d = reshape(k,[1,numel(k)]); E_1d =@(k) 1.453.*k.^4./((1 + k.^2).^(17/6)); E_int = arrayfun(@(i) integral(E_1d,k_1d(i),Inf),1:numel(k_1d)); beta_1d = c*gamma./(k_1d.*sqrt(E_int)); beta = reshape(beta_1d,[size(k,1),size(k,2)]); end
which is just slightly better performing than the previous case.
I'd like to find a way to strongly reduce the computation consumption.
I thank you for any hunch.



