Greetings all,
This is the second part of what I am trying to work out, and I am new to function handles (i.e, @f, if you will). I'm trying to use three programs scripts at once, since someone told me it was best to do it this way, but I'm not seeing it. I'm open to suggestions, but I am seeing an error.
The first script I have contains the line:
R(D,:) = (V_1*F_1 - r)/(V_1*F_1 + r);
where all the terms are defined, and "r" is imaginary (as this issue was resolved yesterday - shout out to Walter Roberson).
I was told to invoke my second script (titled hankel0.m) at the command prompt, but that I had to define a function f.m first (my third script).
So my f.m file contains:
function f=f(r)
f=R(D,r)*r^2*exp(-r*A)
where R(D,r) = R(D,:) = (V_1*F_1 - r)/(V_1*F_1 + r), r is imaginary, and A is a constant - all of these are in the first script. and at the command prompt I say
to invoke the call to hankel0.m, and B is a constant previously defined in my first script as well (and shows up in the variable space).
When I run the command above, I get an "Undefined function or variable 'D'" error. Now, 'D' is defined in my first script as well, and is in the variable space (it's an array of positive integers) since I ran the first script prior to invoking a hankel0 function call at the command prompt.
Obviously I'm doing something wrong, and I am new to function handles. Can anyone break it down for me? Again, I am new to function handles, so go easy on me.