"Francesco Perrone" <email@example.com> wrote in message news:firstname.lastname@example.org... > I have that
> E = @(k) (1.453*k.^4)./((1 + k.^2).^(17/6));
> Afterwards, I compute F_33 as > > for i = 1:numel(k1) count = count + 1; phi_33 = @(k2,k3) > (1.453./(4.*pi)).*(((k1(i)^2+k2.^2+(k3 + > beta(i).*k1(i)).^2).^2)./((k1(i)^2+k2.^2+k3.^2).^2)).*((k1(i)^2+k2.^2)./((1+k1(i)^2+k2.^2+(k3+beta(i).*k1(i)).^2).^(17/6))); > F_33(count) = 4*integral2(phi_33,0,1000,0,1000); end > > Now let's come to my question. I know from a paper that: > > k = sqrt(k1.^2+k2.^2+k3.^2); > k30 = k3 + beta.*k1; > k0 = sqrt(k1.^2+k2.^2+k30.^2); > E_k0 = 1.453.*(k0.^4./((1+k0.^2).^(17/6))); > > Therefore the expression for phi_33 would result in > > phi_33 = (E_k0./(4*pi.*(k.^4))).*(k1.^2+k2.^2); > > The question is: how can I make use of this final expression insted of the > long one I'm using at the moment (within the for loop)?
You have a function for E that you can use to generate E_k0. Change your expressions for k, k30, and k0 into functions then call those functions in your phi_33 function.
Note that saying E(k0) would NOT be sufficient; E doesn't operate on a function handle but on a numeric value, and so you need to evaluate the k0 function and pass the result it returns into the E function.
k1 also needs to be defined before you define ANY of these functions; the function handles will "remember" the value of k1 that existed when they were created.