F_xy = @(t,T_f)(Q_D+Q_d+Q_r+Q_earth+Q_sky-Q_aIR-Q_a-Q_oc)/(m.*C_p)
defines an anonymous function that takes two parameters, ignores them, and instead returns the value of that expression. The expression involves a symbolic variable, so whenever you call F_xy the result is going to be a symbolic expression. You have assigned numeric values to T_f but you have not told MATLAB to replace the symbolic variable T_f with those numeric values. You pass numeric t into F_xy but because you are ignoring that t, no association is made between that t and the symbolic t.
When you assign a numeric value to a variable that was earlier named in a symbolic expression, uses of that expression continue to get the symbolic variable, not the numeric variable! You should have a look at subs()
In the meantime, though, replace
F_xy = @(t,T_f)(Q_D+Q_d+Q_r+Q_earth+Q_sky-Q_aIR-Q_a-Q_oc)/(m.*C_p);
with
F_xy = matlabFunction((Q_D+Q_d+Q_r+Q_earth+Q_sky-Q_aIR-Q_a-Q_oc)/(m.*C_p), 'Vars', [t T_f]);
Best Answer