Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Topic: Handle function implicitly accounting for independent variables
Replies: 2   Last Post: Jan 7, 2013 2:08 PM

 Messages: [ Previous | Next ]
 Francesco Perrone Posts: 39 Registered: 5/2/12
Re: Handle function implicitly accounting for independent variables
Posted: Jan 7, 2013 2:08 PM

Dear Steven Lord,

I changed my approach a little bit.

At the moment I'm doing like this:
1. First I wrote a standard function phi_33_kai

function phi_33 = phi_33_kai(k1,k2,k3,beta,i)
k = sqrt(k1(i).^2 + k2.^2 + k3.^2);
k30 = k3 + k1(i).*beta(i);
k0 = sqrt(k1(i).^2 + k2.^2 + k30.^2);
E_k0 = 1.453.*(k0.^4./((1 + k0.^2).^(17/6)));
phi_33 = E_k0./(4.*pi.*k.^4).*(k1(i).^2 + k2.^2);
end

2. Then, I call that in the previous for loop as follows:

clc,clear all,close all
k1 = (1E-02:0.1:100);
load beta.mat %% the procedure to calculate beta is not reported anymore (see first msg)

F_33 = zeros(1,numel(k1));
count = 0;
for i = 1:numel(k1)
count = count + 1;
phi_33 = @(k2,k3) phi_33_kai(k1,k2,k3,beta,i);
end

Is this way comparable to yours or it has any relevant flaw?

Btw, would you mind to extend your approach with a whole piece of code: I was not able to completely understand it. I thank you in advance.

Kindest regards,
Francesco Perrone

Date Subject Author
1/7/13 Francesco Perrone
1/7/13 Steven Lord
1/7/13 Francesco Perrone