tf_f = @(T,Y) isempty(p_f(T,Y));
if tf_f(T,Y) == 1 && bottom_f(Y) > p21top_f(T)
elseif tf_f(T,Y) == 1 && top_f(Y) < p21top_f(T)
elseif tf_f(T,Y) == 0 && centre_check_f(Y) > p21top_f(T)
elseif tf_f(T,Y) == 0 && centre_check_f(Y) < p21top_f(T)
Not enough code to be able to tell...we don't know where the loop is which is crucial...
But, the crystal ball is back from the shop so let's give it a whirl and see if it is (finally!) repaired or not--
It says, since the content of any variable not passed as a dummy argument into an anonymous function is the value for that variable in the workspace at the time the anonymous function is defined and is invariant, that definition is outside the loop and so the array p_f is constant in the function definition instead of being revised as you expect.
Either pass p_f, too, or don't use the anonymous function but just write the test expression.
(Now to wait and see if I wasted money on the repair bill... :) )