Hi, I have defined global variables (all scalar) in my main script, along with their values.
When calling a function which calls these global variables, and assigning the required inputs, I get an output of zero. Here's my code:
function q1 = Hfcrsk(a,b) global k Cpb Skbfn Cdil Tc0 Cstr Tsk0Tc=a;Tsk=b; Skbf = ((Skbfn + (Cdil.*(Tc-Tc0)))./(1+(Cstr.*(Tsk0-Tsk)))); q1 = (k.*(Tc-Tsk)) + (Skbf.*Cpb.*(Tc-Tsk));
Calling Hfcrsk(30,35) for example always gives a 0 output.
Please help!!! Thanks:)
Best Answer